Jump to content

text appearance when click button, (simple)


Go to solution Solved by JLogan3o13,

Recommended Posts

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?

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

Link to comment
Share on other sites

  • Moderators

Then change the line below to call your function:

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



To:

Case $Button1
            _myFunc()



Edited by JLogan3o13

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

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

Link to comment
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 :)

Link to comment
Share on other sites

  • Moderators
  • Solution

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

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

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