Hello
How to insert a button inside a listicon cell ?
I have found no answers on the forum
Thanks
Button inside a Listicon ?
Re: Button inside a Listicon ?
You are also allowed to use Google. First result: https://www.purebasic.fr/english/viewtopic.php?t=47776
Good morning, that's a nice tnetennba!
PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
Re: Button inside a Listicon ?
For Windows
Add any Gadget at any Cell (I presume
)
If needs more work to do if the Listicon will be scrolled vertically or horizontally
Add any Gadget at any Cell (I presume
If needs more work to do if the Listicon will be scrolled vertically or horizontally
Code: Select all
Procedure WinCallback(hWnd, uMsg, wParam, lParam)
result = #PB_ProcessPureBasicEvents
Select uMsg
Case #WM_NOTIFY
*NMHDR.NMHDR = lParam
If *NMHDR\hWndFrom = GetWindow_(GadgetID(3),#GW_CHILD) And *NMHDR\code = #HDN_ITEMCHANGING
*phdn.NMHEADER = lParam
If *phdn\iItem = 0 Or *phdn\iItem = 1
ProcedureReturn 1
EndIf
EndIf
EndSelect
ProcedureReturn result
EndProcedure
If OpenWindow(0, 0, 0, 800, 600, "ListIcon Example", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
ButtonGadget(1,16,36,94,24,"TEST",#WS_CLIPCHILDREN|#WS_CLIPSIBLINGS)
ButtonGadget(2,110,60,252,24,"TEST #2",#WS_CLIPCHILDREN|#WS_CLIPSIBLINGS)
ListIconGadget(3, 10,10, 780, 580, "Name", 100, #PB_ListIcon_FullRowSelect | #PB_ListIcon_AlwaysShowSelection|#WS_CLIPSIBLINGS)
AddGadgetColumn(3, 1, "", 250)
AddGadgetItem(3, -1, "Harry Rannit"+Chr(10)+"12 Parliament Way, Battle Street")
AddGadgetItem(3, -1, "Ginger"+Chr(10)+"")
AddGadgetItem(3, -1, "Hi"+Chr(10)+"Add any gadget to any cell")
SetWindowCallback(@WinCallback())
Repeat
Select WaitWindowEvent()
Case#PB_Event_CloseWindow
Quit = 1
Case #PB_Event_Gadget
Select EventGadget()
Case 1
Debug "OK"
Case 2
Debug "Another OK"
Case 3
Debug GetGadgetItemText(3, GetGadgetState(3))
EndSelect
EndSelect
Until Quit = 1
EndIf
Egypt my love


