Sign in to follow this  
Followers 0
Rogue5099

Combo Box help needed

7 posts in this topic

Okay, so I have created a Combo Box and entered in the Data.

How I have it setup right now:

$Name = GUICtrlCreateCombo("", 95, 8, 97, 25, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL, $CBS_SIMPLE))
$NameCheck = GUICtrlRead($Name)
AdlibRegister("CheckComboBox", 1000)

Func CheckComboBox()
    If $NameCheck = GUICtrlRead($Name) Then
        ;Skip if same
    Else
        $NameCheck = GUICtrlRead($Name)
        ;Load Info into GUI
    EndIf
EndFunc ;==>CheckComboBox

Without switching to OnEvent (cause I would have to switch everything on GUI to OnEvent), is there a way once the Data is selected to load the info? The way I have it right now is even when you mouse over the data in the combo box CtrlRead reads the item highlighted even though it's not selected.

Share this post


Link to post
Share on other sites



First off these remarks are not to be mean, because I am asking for help.

(more specifically the "create" function)

GUICtrlCreateCombo - Copy and paste anything from this that will explain running a Func after selecting from the list.

Opt("GUIOnEventMode", 1)

I didn't want to go to OnEvent because I would have to switch entire program to that as I stated in the first post. I know it can be done that way and I have done it that way with other programs but I don't want to add 1000 OnEvent lines to my script.

Share this post


Link to post
Share on other sites

GUICtrlCreateCombo - Copy and paste anything from this that will explain running a Func after selecting from the list.

I said UDF. Run the example for _GUICtrlComboBox_Create() and see how $CBN_EDITCHANGE is sent when the edit control changed. Then look on the code for how it's done.

If you are unsure about GUIRegisterMsg() then there's a GUIRegisterMsg Tutorial on the wiki.

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

I said UDF. Run the example for _GUICtrlComboBox_Create() and see how $CBN_EDITCHANGE is sent when the edit control changed. Then look on the code for how it's done.

If you are unsure about GUIRegisterMsg() then there's a GUIRegisterMsg Tutorial on the wiki.

Thank you so much for your help. I liked how you helped with a hint instead of just solving it for me that way I learn a little more. Solved it with one line:

GUIRegisterMsg($CBN_SELENDOK, "CheckComboBox")

Never used GUIRegisterMsg before and I would have never known where to look for the msgID, thanks again!!!

Still working forgot had AdlibRegister Still on...

Edited by rogue5099

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0