Jump to content

Change the data set to a control


Recommended Posts

Hi. Summer is coming so its time to learn AutoIt again. :(

#include <GUIConstants.au3>
$Form1 = GUICreate("GCSD Test", 212, 42, 459, 488, -1, BitOR($WS_EX_TOPMOST,$WS_EX_WINDOWEDGE))
$Button1 = GUICtrlCreateButton("Modify", 128, 8, 75, 25, $BS_DEFPUSHBUTTON)
$Input1 = GUICtrlCreateInput("ORIGINAL", 8, 8, 113, 21, $ES_READONLY)
GUISetState(@SW_SHOW)
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    $msg = $Button1
    GUICtrlSetData($Input1, "MODIFIED");----- this does not work!!
    Case Else
;;;;;;;
    EndSelect
WEnd
Exit

What I want to do is to change the data set to the input control when I click the button. Is it posible?

Thanks! :)

Edited by totoymola
Link to comment
Share on other sites

Hi. Summer is coming so its time to learn AutoIt again. :(

#include <GUIConstants.au3>
$Form1 = GUICreate("GCSD Test", 212, 42, 459, 488, -1, BitOR($WS_EX_TOPMOST,$WS_EX_WINDOWEDGE))
$Button1 = GUICtrlCreateButton("Modify", 128, 8, 75, 25, $BS_DEFPUSHBUTTON)
$Input1 = GUICtrlCreateInput("ORIGINAL", 8, 8, 113, 21, $ES_READONLY)
GUISetState(@SW_SHOW)
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    $msg = $Button1
    GUICtrlSetData($Input1, "MODIFIED");----- this does not work!!
    Case Else
;;;;;;;
    EndSelect
WEnd
Exit

What I want to do is to change the data set to the input control when I click the button. Is it posible?

Thanks! :)

you're problem is on line 11

$msg = $Button1

should be:

case $msg = $button1

the result would be:

#include <GUIConstants.au3>
$Form1 = GUICreate("GCSD Test", 212, 42, 459, 488, -1, BitOR($WS_EX_TOPMOST,$WS_EX_WINDOWEDGE))
$Button1 = GUICtrlCreateButton("Modify", 128, 8, 75, 25, $BS_DEFPUSHBUTTON)
$Input1 = GUICtrlCreateInput("ORIGINAL", 8, 8, 113, 21, $ES_READONLY)
GUISetState(@SW_SHOW)
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        Exit
    Case $msg = $Button1
    GUICtrlSetData($Input1, "MODIFIED");----- this does work now!!
    Case Else
;;;;;;;
    EndSelect
WEnd
Exit
Edited by blademonkey

---"Educate the Mind, Make Savage the Body" -Mao Tse Tung

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...