Combobox-Gadget und Dropdown-arrow
Verfasst: 09.09.2010 20:29
Kann man eigentlich beim Combobox-Gadget die Dropdown-Schaltfläche eliminieren oder zumindest deaktivieren? Habe dazu leider nichts gefunden.
Das deutsche PureBasic-Forum
https://www.purebasic.fr/german/
Code: Alles auswählen
ComboBoxEnabled.L = #True
OpenWindow(0, 0, 0, 270, 190, "Enable/Disable ComboBox", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
ComboBoxGadget(0, 10, 40, 250, 20, #PB_ComboBox_Editable)
ButtonGadget(1, 70, 10, 120, 20, "Disable ComboBox")
For i = 1 To 9
AddGadgetItem(0, -1, "Eintrag " + Str(i))
Next i
SetGadgetState(0, 6)
ComboBoxHandle = GadgetID(0)
ComboBoxEditControlHandle = GetWindow_(ComboBoxHandle, #GW_CHILD)
Repeat
WindowEvent = WaitWindowEvent()
If WindowEvent = #PB_Event_Gadget
If EventGadget() = 1
If ComboBoxEnabled
DisableGadget(0, #True)
SetGadgetText(1, "ComboBox aktivieren")
EnableWindow_(ComboBoxEditControlHandle, #True)
ComboBoxEnabled = #False
Else
DisableGadget(0, #False)
SetGadgetText(1, "ComboBox deaktivieren")
ComboBoxEnabled = #True
EndIf
EndIf
EndIf
Until WindowEvent = #PB_Event_CloseWindow