Comboboxex help...
Posted: Wed Jan 18, 2006 7:12 pm
I've modified an example from the forum of comboboxex...
The problem is how do I make it so the text field is NOT there, or at the very least is not editable?
Any ideas?
Code: Select all
;--> ComboBoxEx Constants
#CBEIF_DI_SETITEM = $10000000
#CBEIF_IMAGE = 2
#CBEIF_INDENT = $10
#CBEIF_LPARAM = $20
#CBEIF_OVERLAY = 8
#CBEIF_SELECTEDIMAGE = 4
#CBEIF_TEXT = 1
#CBEM_INSERTITEMA = #WM_USER + 1
#CBEM_SETIMAGELIST = #WM_USER + 2
;--> ComboBoxEx Structure for adding items
cbi.COMBOBOXEXITEM
cbi\mask = #CBEIF_TEXT | #CBEIF_IMAGE | #CBEIF_SELECTEDIMAGE
;--> Create our 4 images
sizex=96
sizey=128
Dim images(3)
images(0) = CreateImage(0, sizex, sizey)
StartDrawing(ImageOutput())
Box(0, 0, sizex, sizey, RGB(255, 0, 0))
StopDrawing()
images(1) = CreateImage(1, sizex, sizey)
StartDrawing(ImageOutput())
Box(0, 0, sizex, sizey, RGB(0, 255, 0))
StopDrawing()
images(2) = CreateImage(2, sizex, sizey)
StartDrawing(ImageOutput())
Box(0, 0, sizex, sizey, RGB(0, 0, 255))
StopDrawing()
images(3) = CreateImage(3, sizex, sizey)
StartDrawing(ImageOutput())
Box(0, 0, sizex, sizey, RGB(255, 255, 0))
StopDrawing()
If OpenWindow(0, 0, 0, 390, 350, #PB_Window_SystemMenu | #PB_Window_ScreenCentered, "ComboBoxEx") And CreateGadgetList(WindowID(0))
;--> Create ComboBoxEx
hCombo = CreateWindowEx_(0, "ComboBoxEx32", "", #WS_BORDER | #WS_CHILD | #WS_VISIBLE | #CBS_DROPDOWN, 10, 10, 180, 300, WindowID(), 0, GetModuleHandle_(0), 0)
;--> Create ImageList and add our 4 images
hComboIl= ImageList_Create_(sizex, sizey, #ILC_COLOR24, 0, 50)
For i = 0 To 3
ImageList_Add_(hComboIl, images(i), 0)
FreeImage(i)
Next i
;--> Send ImageList to ComboBoxEx
SendMessage_(hCombo, #CBEM_SETIMAGELIST, 0, hComboIl)
;--> Add our items to ComboBoxEx
For i = 0 To 3
cbi\iItem = -1
itemText$ = ""
;cbi\pszText = @itemText$
;cbi\cchTextMax = Len(itemText$)
cbi\iImage = i
cbi\iSelectedImage = i
SendMessage_(hCombo, #CBEM_INSERTITEMA, 0, @cbi)
Next i
quit = #False
Repeat
event = WaitWindowEvent()
If event = #PB_Event_CloseWindow
ImageList_Destroy_(hComboIl)
quit = #True
EndIf
Until quit = #True
EndIf
Any ideas?