Sign in to follow this  
Followers 0
Aceguy

Making $ES_READONLY box Not $ES_READONLY...

7 posts in this topic




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.

Share this post


Link to post
Share on other sites

#3 ·  Posted (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..... :D

Edited by Aceguy

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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 :D :P;):evil:

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

 

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