Restored from previous forum. Originally posted by Kendrel.
I have tried to get the Current selected item inside a combo box with EventType, and it doesnt seem to work...
i have searched the forum and in some old message stood that it is buggy when used with a combobox... is that still buggy or was it an old bug?
i would need a short example, since i couldnt find anything usefull about this one
ComboBox
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Pupil.
How do you mean, get the text of the current item or the item number of the current item?
I don't think EventType() has anything to do with how you get the current item in a combobox, not that i know of anyway..
How do you mean, get the text of the current item or the item number of the current item?
I don't think EventType() has anything to do with how you get the current item in a combobox, not that i know of anyway..
Code: Select all
; To get the current item do this:
item = GetGadgetState(#Your_ComboBox) ; This one is in the PB manual
; To get the text of the current item do this:
text.s = GetGadgetText(#Your_ComboBox) ; This one isn't in the PB manual
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Kendrel.
with item i ment the index...
but i have found out that it must be a bug
Select EventType()
Case #PB_EventType_RightClick ;Selected Item
Result=GetGadgetState(#ComboGadget)
EndSelect
i was thinking #PB_EventType_Change does the trick, but the example above just does what i need...
it seems EventType() is buggy... or the Constants... who knows!
with item i ment the index...
but i have found out that it must be a bug
Select EventType()
Case #PB_EventType_RightClick ;Selected Item
Result=GetGadgetState(#ComboGadget)
EndSelect
i was thinking #PB_EventType_Change does the trick, but the example above just does what i need...
it seems EventType() is buggy... or the Constants... who knows!
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Pupil.
> i was thinking #PB_EventType_Change does the trick, but the example above just does what i need...
well i does say in the manual that that particular eventype is for stringgadgets...
> i was thinking #PB_EventType_Change does the trick, but the example above just does what i need...
well i does say in the manual that that particular eventype is for stringgadgets...
Quote from Purebasic Manual
#PB_EventType_Change : returned when a StringGadget() content change.