Sign in to follow this  
Followers 0
jay

Update GuiCtrlCreateInput

5 posts in this topic

If the Variable changes for the GUICtrlCreateInput how do you update it?

GUICtrlCreateLabel ("Attachment:", 2, 325, 100, 100, -1, -1)

$var = GUICtrlCreateInput($var, 100, 325, 300, 20)

If $msg = $FILES Then

$messageB = "Hold down Ctrl or Shift to choose multiple files."

$var = FileOpenDialog($messageB, "C:\", " (*.*)", 1 + 4 )

If @error Then

MsgBox(4096,"","No File(s) chosen")

Else

$var = StringReplace($var, "|", "", 1, 0)

$var = StringReplace($var, "|", ",", 1, 0)

MsgBox(4096,"","You chose " & $var)

EndIf

Endif

Share this post


Link to post
Share on other sites



I don't really know what you want to do, please be more specific!

Do you wanna change what the input says, the size of the input, the position??

I can't see code that shows your GUI, like GUISetState()...

To me it seems like the posted code is only a part of the script, isn't it? If not, please post a detailed description of what you want your script to do.

also, you can't use $var so often in many different ways, it doesn't work... You can call your variables whatever you want, like $a, $b, $56451sadf, $lolroflmao......

Felix N. (tdlrali)

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

I don't really know what you want to do, please be more specific!

Do you wanna change what the input says, the size of the input, the position??

I can't see code that shows your GUI, like GUISetState()...

To me it seems like the posted code is only a part of the script, isn't it? If not, please post a detailed description of what you want your script to do.

also, you can't use $var so often in many different ways, it doesn't work... You can call your variables whatever you want, like $a, $b, $56451sadf, $lolroflmao......

Felix N. (tdlrali)

If the value of $var changes i want the $var = GUICtrlCreateInput($var, 100, 325, 300, 20)

to update with the new info it would be just the text data

If $msg = $FILES Then

$messageB = "Hold down Ctrl or Shift to choose multiple files."

$var = FileOpenDialog($messageB, "C:\", " (*.*)", 1 + 4 )

;this is where the value would change if someone selects the $FILES

If @error Then

MsgBox(4096,"","No File(s) chosen")

Else

$var = StringReplace($var, "|", "", 1, 0)

$var = StringReplace($var, "|", ",", 1, 0)

MsgBox(4096,"","You chose " & $var)

EndIf

Endif

Edited by jay

Share this post


Link to post
Share on other sites

If the value of $var changes i want the $var = GUICtrlCreateInput($var, 100, 325, 300, 20)

to update with the new info it would be just the text data

If $msg = $FILES Then

$messageB = "Hold down Ctrl or Shift to choose multiple files."

$var = FileOpenDialog($messageB, "C:\", " (*.*)", 1 + 4 )

;this is where the value would change if someone selects the $FILES

If @error Then

MsgBox(4096,"","No File(s) chosen")

Else

$var = StringReplace($var, "|", "", 1, 0)

$var = StringReplace($var, "|", ",", 1, 0)

MsgBox(4096,"","You chose " & $var)

EndIf

Endif

I think i got it

Share this post


Link to post
Share on other sites

To get the text thats in an input box u do this:

GUICtrlCreateLabel ("Attachment:", 2, 325, 100, 100, -1, -1)
$input1 = GUICtrlCreateInput("", 100, 325, 300, 20)
$atttachment = GUICtrlRead($input1)

This would read the text from the input box. If you want it to read the text after somebody presses, lets say the OK button than you would do this:

#include <GuiConstants.au3>
GUICreate("TestGUI",300,100)
GUICtrlCreateLabel("Attachment:",10,10,70,20)
$input1 = GUICtrlCreateInput("", 90, 10, 200, 20)
$button1 = GUICtrlCreateButton("OK",10,40,70,30)
GUISetState()
While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $button1
            $attachment = GUICtrlRead($input1)
            MsgBox(0,"Attachment","The attachment is:" & @CR & $attachment)
            ExitLoop
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
    EndSelect
WEnd
Exit

HF

Felix N. (tdlrali)

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