Sign in to follow this  
Followers 0

an input box thats uneditable?

3 posts in this topic

#1 ·  Posted (edited)

I am building a text based adventure with a gui with multiple commands like go left, go right, pick up item or something like that, i need a counter for how many times a button was clicked counting down, ive tried making an updown and having the maximum and minimum on 100 but have another button that would -1 to it but it is still editable... can this be done elsewise?

i have tried:



$count = GuiCtrlCreateInput("200",860, 600, 50, 25,$ES_READONLY)

but didnt work out

Edited by MethodZero

[center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center]

Share this post

Link to post
Share on other sites

You could always use a label.

Share this post

Link to post
Share on other sites

#include <GUIConstants.au3>

GUICreate(" My GUI input", 320,120)
$input = GUICtrlCreateInput ( "", 10,  5, 300, 20)
$btn = GUICtrlCreateButton ("Ok", 40,  75, 60, 20)
GUICtrlSendMsg($input, $EM_SETREADONLY, True, 0)
GUICtrlSetBkColor($input, 0xFFFFFF)

GUISetState () 
GUICtrlSetData($input,"my disabled input")
$msg = 0
While $msg <> $GUI_EVENT_CLOSE
       $msg = GUIGetMsg()
           Case $msg = $btn

MsgBox (4096, "Result", GUICtrlRead($input))

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