Sign in to follow this  
Followers 0
chazzmani

Converting Menu Selections to Dropdown (Combo) Boxes

5 posts in this topic

Hi all. I am trying to convert a script that allows users to pick options from an option menu to allowing them to pick options from a dropdown (combo) box. Can someone assist? Right now, this is how the menu option code looks:

$Optionselect = GUICtrlCreateMenu("Select Option", $MenuOptions)

$A1[0] = GUICtrlCreateMenuItem("Option a", $Optionselect) ; create first item

$A1[1] = GUICtrlCreateMenuItem("Option b", $Optionselect) ; create 2nd item

$A1[2] = GUICtrlCreateMenuItem("Option c", $Optionselect) ; create 3rd item

$A1[3] = GUICtrlCreateMenuItem("Other", $Optionselect) ; create 4th item

As you can see, variable A1 is driven by the menu selection. How do I convert that into 'GUICtrlCreateCombo' code? My first attempt looked something like this:

$A1[0] = GUICtrlCreateCombo ("Option a", 95,139,76,10) ; create first item

GUICtrlSetData(-1,"Option b|Option c|Other") ; add more items

This makes the combo box appear correctly, but I don't how to assign subsequent options to the proper variables the same way I did in the menu control. Again, I want to get completely away from using a menu-driven control and move to a dropdown control.

Thanks!

Share this post


Link to post
Share on other sites



Hi all. I am trying to convert a script that allows users to pick options from an option menu to allowing them to pick options from a dropdown (combo) box. Can someone assist? Right now, this is how the menu option code looks:

$Optionselect = GUICtrlCreateMenu("Select Option", $MenuOptions)

$A1[0] = GUICtrlCreateMenuItem("Option a", $Optionselect) ; create first item

$A1[1] = GUICtrlCreateMenuItem("Option b", $Optionselect) ; create 2nd item

$A1[2] = GUICtrlCreateMenuItem("Option c", $Optionselect) ; create 3rd item

$A1[3] = GUICtrlCreateMenuItem("Other", $Optionselect) ; create 4th item

As you can see, variable A1 is driven by the menu selection. How do I convert that into 'GUICtrlCreateCombo' code? My first attempt looked something like this:

$A1[0] = GUICtrlCreateCombo ("Option a", 95,139,76,10) ; create first item

GUICtrlSetData(-1,"Option b|Option c|Other") ; add more items

This makes the combo box appear correctly, but I don't how to assign subsequent options to the proper variables the same way I did in the menu control. Again, I want to get completely away from using a menu-driven control and move to a dropdown control.

Thanks!

Not a good idea to double post.

I have given a second answer to your earlier thread in the Graphical User Interface support forum.


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

Not a good idea to double post.

I have given a second answer to your earlier thread in the Graphical User Interface support forum.

My apologies. I tried to go into the first post and delete it and could not find an option to do so. Is that possible?

In any event, thank you.

Share this post


Link to post
Share on other sites

My apologies. I tried to go into the first post and delete it and could not find an option to do so. Is that possible?

In any event, thank you.

No problem.

I think you can only delete posts which do not have replies, and maybe you can't even delete those until you have a certain number of posts.


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

No problem.

I think you can only delete posts which do not have replies, and maybe you can't even delete those until you have a certain number of posts.

I am finding this forum gets MUCH more traffic than the other ones... live and learn I guess.

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