Jump to content

2 questions with an input box


Recommended Posts

1. is there a chance to do a request, if an input box is marked, so, that you can type in it?

2. do you can change the value, which is shown in an input box?

f.e.:

$input = GUICtrlCreateInput("bla", ...)

$input = "nyo" or $input = GUICtrlSetData("nyo")

dont changes the value...

Link to comment
Share on other sites

thx!

does anybody know if here is a way to have a request like If input box is marked?

<{POST_SNAPBACK}>

See if this helps you any.

#include <GuiConstants.au3>

$gui = GuiCreate("MyGUI", 392, 323,(@DesktopWidth-392)/2, (@DesktopHeight-323)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)
$Input_1 = GuiCtrlCreateInput("Input1", 40, 20, 310, 190)
$Button_2 = GuiCtrlCreateButton("set focus to this button", 50, 220, 290, 40)
$Button_3 = GuiCtrlCreateButton("set focus to the input", 50, 280, 290, 40)
GuiSetState()
While 1
    $msg = GuiGetMsg()
    $b = ControlGetFocus ( $gui )
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case $msg = $Button_2
        $a = ControlGetFocus ( $gui )
        MsgBox(0,$a,$a)
    Case $msg = $Button_3   
        ControlFocus($gui, "", $Input_1)
        MsgBox(0,"","Changeing the focus to the $Input_1 also known as edit1")
        $a = ControlGetFocus ( $gui )
        MsgBox(0,"The new focus is "&$a,"The new focus is "&$a)
        If $a = "edit1" Then
            MsgBox(0,$a,"I hope this helps you.")
        EndIf   
;;;;;;;;;;;;;;;$b = ControlGetFocus ( $gui )    
    Case $b = "edit1"
        msgBox(0,$b,"I hope this helps you.")
        ControlFocus($gui, "", $Button_2)
        MsgBox(0,"","Changeing the focus to $Button_2 also known as button1")
        $a = ControlGetFocus ( $gui )
        MsgBox(0,"The new focus is "&$a,"The new focus is "&$a)
        
    EndSelect
WEnd
Exit
Edited by quick_sliver007

.

Link to comment
Share on other sites

hm tryed it but it dont works at my script o.O... im going to check it another times.... but the code is like the code in your example o.O

<{POST_SNAPBACK}>

The exsample should work just fine. I think what is getting you is that controlID's are not the same as the variables you set to the controls. The MsgBoxes are there to show you that. Like "edit1" is the controlID of the control $Input_1 in the script.

Also did you try clicking the Input? Try clicking the different controls in the GUI to see the results.

Edited by quick_sliver007

.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...