Aceguy Posted June 25, 2006 Posted June 25, 2006 i have an input box, where i have set the state to $ES_READONLY.... however i would like to (when i click a button) to change the inputbox from $ES_READONLY, back to being able to input agin. please help [u]My Projects.[/u]Launcher - not just for games & Apps (Mp3's & Network Files)Mp3 File RenamerMy File Backup UtilityFFXI - Realtime to Vana time Clock
JayJay Posted June 25, 2006 Posted June 25, 2006 however i would like to (when i click a button) to change the inputbox from $ES_READONLY, back to being able to input agin.ControlEnable() and ControlDisable() can switch your inputbox on/off, then you don't need the readonly flag.
Aceguy Posted June 25, 2006 Author Posted June 25, 2006 (edited) Yes Works a Treat TY. is there anyway to change the colours of the text and bacground as this inputbox recieves data from a inifile. Hence the reason why i dont want to edit it. Untill later........(ie, edit button or something)...... thanks for your help sofar tho..... Edited June 25, 2006 by Aceguy [u]My Projects.[/u]Launcher - not just for games & Apps (Mp3's & Network Files)Mp3 File RenamerMy File Backup UtilityFFXI - Realtime to Vana time Clock
Thatsgreat2345 Posted June 25, 2006 Posted June 25, 2006 This is your GUI or another? #include <GUIConstants.au3> $Write = 1 $Form1 = GUICreate("AForm1", 201, 101, 192, 125) $Input = GUICtrlCreateInput("", 8, 8, 193, 21, -1, $WS_EX_CLIENTEDGE) $Button = GUICtrlCreateButton("Write", 56, 56, 73, 33) GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() If $msg = $Button Then If $Write = 1 Then GUICtrlSetState($Input,$GUI_DISABLE) $Write = 0 GUICtrlSetData($Button,"DONT WRITE") Elseif $Write = 0 Then $Write = 1 GUICtrlSetState($Input,$GUI_ENABLE) GUICtrlSetData($Button,"Write") EndIf EndIf IF $msg = $GUI_EVENT_CLOSE then Exit WEnd
Aceguy Posted June 25, 2006 Author Posted June 25, 2006 Sorry, not mine..... but this is it... And working now thanks..... $Main = GUICreate('Main', 200, 100) $input = GUICtrlCreateInput('', 10, 10, 50, 50) ControlDisable($Main,"",$input) GUICtrlSetBkColor($input,0xffffff) $Button = GUICtrlCreateButton("", 50, 40, 100, 30) GUICtrlSetData($Button,"Disabled") GUISetState() while 1 $MSG = GUIGetMsg() Select case $MSG = - 3 Exit case $MSG = $Button $read=GUICtrlRead($Button) if $read="Disabled" Then ControlEnable($Main,"",$input) GUICtrlSetData($Button,"Enabled") Else ControlDisable($Main,"",$input) GUICtrlSetBkColor($input,0xffffff) EndIf EndSelect WEnd thanks..... :D [u]My Projects.[/u]Launcher - not just for games & Apps (Mp3's & Network Files)Mp3 File RenamerMy File Backup UtilityFFXI - Realtime to Vana time Clock
Thatsgreat2345 Posted June 25, 2006 Posted June 25, 2006 i would advise not use controlenable /disable when its your own GUI , look at guictrlsetstate with $GUI_ENABLE or $GUI_DISABLE like i did in my script
GaryFrost Posted June 25, 2006 Posted June 25, 2006 this also works but you need beta #include <GuiConstants.au3> Global Const $EM_SETREADONLY = 0xCF $Main = GUICreate('Main', 200, 100) $input = GUICtrlCreateInput('', 10, 10, 50, 50) GUICtrlSendMsg($input, $EM_SETREADONLY, 1, 0) GUICtrlSetBkColor($input, 0xffffff) $Button = GUICtrlCreateButton("", 50, 40, 100, 30) GUICtrlSetData($Button, "Disabled") GUISetState() While 1 $MSG = GUIGetMsg() Select Case $MSG = $GUI_EVENT_CLOSE Exit Case $MSG = $Button $read = GUICtrlRead($Button) If $read = "Disabled" Then GUICtrlSendMsg($input, $EM_SETREADONLY, 0, 0) GUICtrlSetData($Button, "Enabled") Else GUICtrlSendMsg($input, $EM_SETREADONLY, 1, 0) GUICtrlSetData($Button, "Disabled") EndIf EndSelect WEnd SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference.
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