Sign in to follow this  
Followers 0
shadedNabz

How to lock input in a textbox

7 posts in this topic

#1 ·  Posted (edited)

I tried Blockinput(1) but that didn't seem to work. Thing is, i have GUI textbox to show which button to press, lets say "F" but i don't want myself to write anything in it once it is compiled...

GUICtrlCreateLabel("Press", 2, 10)

$key1 = GUICtrlCreateInput("F", 65, 8, 120)

Edited by shadedNabz

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

not working :/

Edited by shadedNabz

Share this post


Link to post
Share on other sites

not working :/

It works for me. Try it again. Example:

#include <GUIConstants.au3>
#include <EditConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 300, 200, -1, -1)
GUICtrlCreateLabel("Press", 2, 10)
$key1 = GUICtrlCreateInput("F", 65, 8, 120, 21, $ES_READONLY)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

#include <ByteMe.au3>

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Ok this is what the msg box says...

autoit error

$key1 = GUICtrlCreateInput("F", 65, 8, 120, $ES_READONLY)

$key1 = GUICtrlCreateInput("F", 65, 8, 120, ^ERROR

Error:Variable used without being declared

EDIT: do i need special version of autoit for this fuction to work? because that function doesn't show up as a suggestion when i'm typing it down

Edited by shadedNabz

Share this post


Link to post
Share on other sites

Sorry, $ES_Readonly needs #include <EditConstants.au3> at the beginning of a script.

Also, the input doesnt have the right number of parameters, i did not fix that when i made your example, should be

$key1 = GUICtrlCreateInput("F", 65, 8, 120, 24, $ES_READONLY)

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