Sign in to follow this  
Followers 0
schilbiz

How do you block input in a GUICtrlCreateCombo?

4 posts in this topic

#1 ·  Posted (edited)

I have a list of computer names that I want to use in a GUICtrlCreateCombo but I do not want the users to have access to the servers; so I would like to either exclude them from the dropdown list and not allow the user to type any information into the combo box, or somehow disable several specific server names from being typed in.

I imagined it would be something to do with GuiCtrlSetData but have not found anything that points me in the correct direction yet.

Also is there a way to have a list of usernames in the GUICtrlCreateCombo that pertain to a computer and would populate the combo box upon selecting the name?

Any help would be appreciated,

Code snippet:

$L_Username = GUICtrlCreateLabel("Use the down arrow to select a Computer.", 15, 35, 220, 32, $SS_SUNKEN)
GUICtrlSetFont($L_Username, 9, 400, "", "Times New Roman")
$I_User = GUICtrlCreateCombo("", 15, 80, 220, 21)
GUICtrlSetData(-1,"computer1|computer2|computer3|etc")

$L_EndProcess = GUICtrlCreateLabel("Use the down arrow to select a Process.", 15, 150, 220, 32, $SS_SUNKEN)
GUICtrlSetFont($L_EndProcess, 9, 400, "", "Times New Roman")
$I_Process = GUICtrlCreateCombo("", 15, 195, 220, 21)
GUICtrlSetData(-1,"excel.exe|outlook.exe|winlogon.exe")
Edited by schilbiz

Share this post


Link to post
Share on other sites

not allow the user to type any information into the combo box

$CBS_DROPDOWNLIST

Ex:

$I_User = GUICtrlCreateCombo("", 15, 80, 220, 21, $CBS_DROPDOWNLIST)
$I_Process = GUICtrlCreateCombo("", 15, 195, 220, 21, $CBS_DROPDOWNLIST)

AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line

Share this post


Link to post
Share on other sites

I have a list of computer names that I want to use in a GUICtrlCreateCombo but I do not want the users to have access to the servers; so I would like to either exclude them from the dropdown list and not allow the user to type any information into the combo box, or somehow disable several specific server names from being typed in.

I imagined it would be something to do with GuiCtrlSetData but have not found anything that points me in the correct direction yet.

Also is there a way to have a list of usernames in the GUICtrlCreateCombo that pertain to a computer and would populate the combo box upon selecting the name?

Any help would be appreciated,

Code snippet:

$L_Username = GUICtrlCreateLabel("Use the down arrow to select a Computer.", 15, 35, 220, 32, $SS_SUNKEN)
GUICtrlSetFont($L_Username, 9, 400, "", "Times New Roman")
$I_User = GUICtrlCreateCombo("", 15, 80, 220, 21)
GUICtrlSetData(-1,"computer1|computer2|computer3|etc")

$L_EndProcess = GUICtrlCreateLabel("Use the down arrow to select a Process.", 15, 150, 220, 32, $SS_SUNKEN)
GUICtrlSetFont($L_EndProcess, 9, 400, "", "Times New Roman")
$I_Process = GUICtrlCreateCombo("", 15, 195, 220, 21)
GUICtrlSetData(-1,"excel.exe|outlook.exe|winlogon.exe")oÝ÷ Ûú®¢×*.ºÇ­í7è R
å,²Ü¥zë®Ì"Z'&Þi¹^¶ç-צ±úèØ^+-Ê©®âu殶­sbb33c´õW6W"ÒuT7G&Ä7&VFT6öÖ&ògV÷C²gV÷C²ÂRÂÂ##Â#Â&"b33c´4%5ôE$õDõtäÄ5BÂb33c´4%5ôUDô45$ôÄÂÂb33cµu5õe45$ôÄÂÂb33cµu5õD%5Dõ

"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Okay thanks guys! I understand both of those suggestions and how to implement them.

Edited by schilbiz

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