ComboBox - Set to 'open' sate ?

BlitzMax Forums/BlitzMax Programming/ComboBox - Set to 'open' sate ?

EOF(Posted 2006) [#1]
(Thread Title: Combobox - Set to 'OPEN' state?)

Is there a way to create a combobox and have it opened just as though the user had clicked the down arrow?

A Win32 call will be fine.


Kev(Posted 2006) [#2]
Hi jim, under win32 send the message CB_SHOWDROPDOWN

SendmessageA QueryGadget(combobox,QUERY_HWND),CB_SHOWDROPDOWN,True,0


EOF(Posted 2006) [#3]
Kev,
Do you know the correct value for CB_SHOWDROPDOWN ?
I can't get the combobox to drop ..

Example:
SuperStrict

Extern "Win32"
	Function SendMessageA(hwnd%,wMsg%,wParam%,lParam%)
End Extern


Const WM_USER%=$400

Const CB_SHOWDROPDOWN%=$14
'Const CB_SHOWDROPDOWN%=WM_USER+15


Global win:tgadget=CreateWindow("temp",200,200,400,300,Null)

Global cb:tgadget=CreateComboBox(10,25,130,20,win)
AddGadgetItem cb,"test abcd"
AddGadgetItem cb,"test zyxwv"
SelectGadgetItem cb,0
'ActivateGadget cb
SendmessageA QueryGadget(cb,QUERY_HWND),CB_SHOWDROPDOWN,True,0


Repeat
	Select WaitEvent()
		Case EVENT_WINDOWCLOSE
		Exit
	End Select
Forever



kfprimm(Posted 2006) [#4]
SuperStrict

Import PUB.Win32

Global win:tgadget=CreateWindow("temp",200,200,400,300,Null)

Global cb:tgadget=CreateComboBox(10,25,130,20,win)
AddGadgetItem cb,"test abcd"
AddGadgetItem cb,"test zyxwv"
SelectGadgetItem cb,0
'ActivateGadget cb
SendmessageA(QueryGadget(cb,QUERY_HWND),CB_SHOWDROPDOWN,True,0)


Repeat
	Select WaitEvent()
		Case EVENT_WINDOWCLOSE
		Exit
	End Select
Forever


This works...SendMessageA is already defined in PUB.Win32, along with CB_SHOWDROPDOWN.


Kev(Posted 2006) [#5]
*edit Khomy Prime got to the finish line first.


EOF(Posted 2006) [#6]
Thanks guys. Works perfectly *

* need to use SetPointer POINTER_DEFAULT otherwise pointer is stuck on busy 'hour glass'
SuperStrict

Extern "Win32"
	Function SendMessageA(hwnd%,wMsg%,wParam%,lParam%)
End Extern

Const CB_SHOWDROPDOWN%=$14F

Global win:tgadget=CreateWindow("temp",200,200,400,300,Null)

Global cb:tgadget=CreateComboBox(10,25,130,20,win)
AddGadgetItem cb,"test abcd"
AddGadgetItem cb,"test zyxwv"
SelectGadgetItem cb,0
SendmessageA QueryGadget(cb,QUERY_HWND),CB_SHOWDROPDOWN,1,0
ActivateGadget cb
SetPointer POINTER_DEFAULT

Repeat
	Select WaitEvent()
		Case EVENT_WINDOWCLOSE
		Exit
	End Select
Forever