mhmed21 Posted August 5, 2015 Posted August 5, 2015 السلام عليكم ورحمهه الله وبركاتهه شباب ابغا كود اذا ضغط ع الكلام يلي داخل ال gridlist يطلع الكلام في اليدت بوكس آتمنى فهمتوني
iMr.SFA7 Posted August 5, 2015 Posted August 5, 2015 guiGridListGetItemText guiGridListGetSelectedItem guiSetText
M[ROYAL]R Posted August 5, 2015 Posted August 5, 2015 ما جربت Window = {}; GridList = {}; Button = {}; Edit[1] = guiCreateEdit(12,75,166,28,"",false) Button[1] = guiCreateButton(49, 176, 105, 30, "اغلاق", false) GridList[1] = guiCreateGridList(9, 23, 174, 143, false) guiGridListAddColumn(GridList[1], "Word", 0.3) List = { { 'word_grid',word_edit'}, } for i, c in ipairs ( List ) do local aRow = guiGridListAddRow ( GridList[1] ) guiGridListSetItemText ( GridList[1], aRow, 1, c[1], false, false ) end addEventHandler("onClientGUIClick",root, function () if ( source == Button[1] ) then Sword = guiGridListGetItemText ( GridList[1], guiGridListGetSelectedItem ( GridList[1] ), 2 ) guiSetText(Edit[1],Sword) end end )
The Killer Posted August 5, 2015 Posted August 5, 2015 تهنيني على ايش عندك خطأ بالكود حقك ما جربت Window = {}; GridList = {}; Button = {}; Edit[1] = guiCreateEdit(12,75,166,28,"",false) Button[1] = guiCreateButton(49, 176, 105, 30, "اغلاق", false) GridList[1] = guiCreateGridList(9, 23, 174, 143, false) guiGridListAddColumn(GridList[1], "Word", 0.3) List = { { 'word_grid',word_edit'}, } for i, c in ipairs ( List ) do local aRow = guiGridListAddRow ( GridList[1] ) guiGridListSetItemText ( GridList[1], aRow, 1, c[1], false, false ) end addEventHandler("onClientGUIClick",root, function () if ( source == Button[1] ) then Sword = guiGridListGetItemText ( GridList[1], guiGridListGetSelectedItem ( GridList[1] ), 2 ) guiSetText(Edit[1],Sword) end end ) سطر 16 ضايف علامة تنصيص ناقصه وخربت كل الكود .. ! المهم لصاحب الموضوع تقدر تسويها كذا btn = guiCreateButton (...) grid = guiCreateGridList (...) guiGridListAddColumn (...) edit = guiCreateEdit (...) addEventHandler ("onClientGUIClick", resourceRoot, function () if (source == btn) then local row = guiGridListGetSelectedItem (grid) local select = guiGridListGetItemText (grid, row, 1) if (select and select ~= "") then guiSetText (edit, select) else guiSetText (edit, "") end end end )
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now