Sign in to follow this  
Followers 0
Arclite86

text appearance when click button, (simple)

8 posts in this topic

i have this code here

#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 282, 93, 192, 124)
$Edit1 = GUICtrlCreateEdit("", 0, 40, 281, 49)
GUICtrlSetData(-1, "")
$Button1 = GUICtrlCreateButton("start showing text", 0, 0, 281, 41)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

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

i want that if you push the "start showing text" button,

a text will appearance on the $edit1  display

how can i do this?

Share this post


Link to post
Share on other sites



#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 282, 93, 192, 124)
$Edit1 = GUICtrlCreateEdit("", 0, 40, 281, 49)
GUICtrlSetData(-1, "")
$Button1 = GUICtrlCreateButton("start showing text", 0, 0, 281, 41)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            GUICtrlSetData($Edit1, "Text to show")
    EndSwitch
WEnd

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

thank you, that was what i was looking for

Edited by Arclite86

Share this post


Link to post
Share on other sites

and what if you want to activate a function ?

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Then change the line below to call your function:

Case $Button1
            GUICtrlSetData($Edit1, "Text to show")



To:

Case $Button1
            _myFunc()



Edited by JLogan3o13

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ###Form=

$Form1 = GUICreate("Form1", 282, 93, 192, 124)
$Edit1 = GUICtrlCreateEdit("", 0, 40, 281, 49)
GUICtrlSetData(-1, "")
$Button1 = GUICtrlCreateButton("start showing text", 0, 0, 281, 41)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            GUICtrlSetData($Edit1, "Text to show")
            _MyFunction()
    EndSwitch
WEnd

Func _MyFunction()
    MsgBox(0, "Box", "I am called from a function" )
EndFunc

Share this post


Link to post
Share on other sites

i am trying to activate this but it doesn work somehow

#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <IE.au3>
#include <String.au3>


#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 282, 93, 192, 124)
$Edit1 = GUICtrlCreateEdit("", 0, 40, 281, 49)
GUICtrlSetData(-1, "item1")
$Button1 = GUICtrlCreateButton("start showing text", 0, 0, 281, 41)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

Call ("find")
Func find()
$oIE = _IECreate("https://twitter.com/followbacklist3",1,0)
$oInputs = _IETagNameGetCollection($oIE, "a")
For $oInput In $oInputs
    If $oInput.className() = "js-nav" Then
        If StringInStr($oInput.innerHTML(), 'Volgers') Then
            ConsoleWrite(_StringBetween($oInput.innerHTML(),'>','<')[0] & @CRLF)
            ExitLoop
        EndIf
    EndIf

Next
EndFunc

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            GUICtrlSetData($Edit1, "Text to show")
            _MyFunction(find)
    EndSwitch
WEnd

by the way, does somebody know the basic tutorials for GUI, or tell me how you guys have learn this all, so i dont have to ask all the time :)

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

Change this:

Case $Button1
            GUICtrlSetData($Edit1, "Text to show")
            _MyFunction(find)

to this:

Case $Button1
            GUICtrlSetData($Edit1, "Text to show")
            find()

Edit: as to learning about GUIs, there are some tutorials on the Wiki, but the examples in the help file is how I learned.

Edited by JLogan3o13

√-1 2^3 ∑ π, and it was delicious!

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