HockeyFan Posted January 8, 2007 Posted January 8, 2007 OK, it's Monday, it's raining...and I need an extra set of eyes to look at my script. What I am trying to do is have the "OK" button in my script be disabled until text is typed in the "Last Name" {$InputlastName} Input box. Can someone take a look and see what I'm missing? expandcollapse popup#include <GuiConstants.au3> #include <Misc.au3> Opt("GUIOnEventMode", 1) $font = "Arial Bold" WinMinimizeAll() GuiCreate("", 400, 316,-1, -1 , $WS_EX_TOPMOST) GUISetBkColor (0xFFFFFF) $GUIMainText = GuiCtrlCreateLabel("Please type the following information: ", 20, 20, 350, 30) GUICtrlSetFont(-1, 14, 400, 0, $font) GUICtrlSetColor ($GUIMainText, 0xFF0000) $LabelFirstName = GuiCtrlCreateLabel("First Name:", 20, 70, 350, 20) GUICtrlSetFont(-1, 12, 400, 0, $font) $InputFirstName = GuiCtrlCreateInput("", 20, 90, 350, 30) GUICtrlSetFont(-1, 12, 400, 0, $font) GUICtrlSetColor ($InputFirstName, 0x0033FF) $LabelLastName = GuiCtrlCreateLabel("Last Name:", 20, 140, 350, 20) GUICtrlSetFont(-1, 12, 400, 0, $font) $InputlastName = GuiCtrlCreateInput("", 20, 160, 350, 30) GUICtrlSetFont(-1, 12, 400, 0, $font) GUICtrlSetColor ($InputlastName, 0x0033FF) $OKButton6 = GuiCtrlCreateButton("OK", 135, 225, 120, 30) GUICtrlSetOnEvent($OKButton6, "OKButton") GuiSetState() ControlDisable("Please type the following information: ", "OK", 8) $dll = DllOpen("C:\WINDOWS\system32\user32.dll") $TypedName = GUICtrlRead($InputlastName) Do Sleep(100) $TypedName = GUICtrlRead($InputlastName) Until $TypedName <> "" ControlEnable("Please type the following information: ", "OK", 8) DllClose($dll) While 1 Sleep(10) WEnd Exit Func OKButton() Exit EndFunc Thank you once again!!
GaryFrost Posted January 8, 2007 Posted January 8, 2007 Hello............anybody out there?? Nope, no one here expandcollapse popup#include <GuiConstants.au3> #include <Misc.au3> Opt("GUIOnEventMode", 1) $font = "Arial Bold" WinMinimizeAll() GuiCreate("", 400, 316,-1, -1 , $WS_EX_TOPMOST) GUISetBkColor (0xFFFFFF) $GUIMainText = GuiCtrlCreateLabel("Please type the following information: ", 20, 20, 350, 30) GUICtrlSetFont(-1, 14, 400, 0, $font) GUICtrlSetColor ($GUIMainText, 0xFF0000) $LabelFirstName = GuiCtrlCreateLabel("First Name:", 20, 70, 350, 20) GUICtrlSetFont(-1, 12, 400, 0, $font) $InputFirstName = GuiCtrlCreateInput("", 20, 90, 350, 30) GUICtrlSetFont(-1, 12, 400, 0, $font) GUICtrlSetColor ($InputFirstName, 0x0033FF) $LabelLastName = GuiCtrlCreateLabel("Last Name:", 20, 140, 350, 20) GUICtrlSetFont(-1, 12, 400, 0, $font) $InputlastName = GuiCtrlCreateInput("", 20, 160, 350, 30) GUICtrlSetFont(-1, 12, 400, 0, $font) GUICtrlSetColor ($InputlastName, 0x0033FF) $OKButton6 = GuiCtrlCreateButton("OK", 135, 225, 120, 30) GUICtrlSetOnEvent($OKButton6, "OKButton") GUICtrlSetState($OKButton6, $GUI_DISABLE) GuiSetState() ;~ ControlDisable("Please type the following information: ", "OK", 8) $dll = DllOpen("C:\WINDOWS\system32\user32.dll") $TypedName = GUICtrlRead($InputlastName) Do Sleep(100) $TypedName = GUICtrlRead($InputlastName) Until $TypedName <> "" ;~ ControlEnable("Please type the following information: ", "OK", 8) GUICtrlSetState($OKButton6, $GUI_ENABLE) DllClose($dll) While 1 Sleep(10) WEnd Exit Func OKButton() Exit EndFunc SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference.
HockeyFan Posted January 8, 2007 Author Posted January 8, 2007 Neveremind...I finally figured out what my mistake was. It helps to just walk away some times.. I was calling the wrong title. My script should have been: ControlDisable("", "OK", 8) :">
GaryFrost Posted January 8, 2007 Posted January 8, 2007 Neveremind...I finally figured out what my mistake was. It helps to just walk away some times.. I was calling the wrong title. My script should have been: ControlDisable("", "OK", 8) :"> There's no need to use ControlDisable etc.... when your disabling/enabling controls with-in the script, see my above post. SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference.
HockeyFan Posted January 8, 2007 Author Posted January 8, 2007 There's no need to use ControlDisable etc.... when your disabling/enabling controls with-in the script, see my above post.Thank you once again. Thanks for the input.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now