Sign in to follow this  
Followers 0
vvb

[Solved] Callback for ComboBox

3 posts in this topic

#1 ·  Posted (edited)

Hi All,

I have a combobox created via GUICtrlCreateCombo. What I want to do is to call a user defined function when the user changes the selection. I have tried using GUICtrlSetOnEvent, however it does not trigger the callback function at all. It works for buttons and checkboxes and radio boxes.

Anyone know how to capture combobox selection change so that I can update another field according to what the user has selected?

Kind Regards,

Vlad

Edited by vvb

I'll be AutoIting my entire system soon.

Share this post


Link to post
Share on other sites



Hi,

Take a look at the _GUICtrlComboBox_Create function in the help file.

You will see that the WM_COMMAND is your callback function and the code you need is $CBN_SELCHANGE.

You can use the built-in GUICtrlCreateComboBox and use the $iIDFrom var instead of the $hWndFrom one.

Br, FireFox.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

Hi FireFox,

Cheers for that. Found out why my GUICtrlSetOnEvent for the ComboBox was not working, I had the wrong parameter passed in. Was using a single generic function to create controls with callbacks like buttons, radio buttons, checkboxes, comboboxes etc and was passing in the wrong parameter so the callback was never called.

Cheers,

Vlad


I'll be AutoIting my entire system soon.

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