Jump to content
Sign in to follow this  
Arclite86

text appearance when click button, (simple)

Recommended Posts

Arclite86

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
dcat127

#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
Arclite86

thank you, that was what i was looking for

Edited by Arclite86

Share this post


Link to post
Share on other sites
Arclite86

and what if you want to activate a function ?

Share this post


Link to post
Share on other sites
Geir1983

#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
Arclite86

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
JLogan3o13

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!

How to get your question answered on this forum!

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  

×