youtuber

Edit Counting when added?

3 posts in this topic

#1 ·  Posted

Is this true?

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

$Form1 = GUICreate("Form1", 158, 202)
$Edit1 = GUICtrlCreateEdit("", 8, 16, 137, 121)
GUICtrlSetData(-1, "Edit1")
$Label1 = GUICtrlCreateLabel("Number added : ", 8, 160, 83, 17)
$additionsLabel = GUICtrlCreateLabel("", 96, 160, 36, 17)
GUISetState(@SW_SHOW)

While 1
    _AddedNum() ;Is this true?
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

Func _AddedNum()
Local $Edititems = StringSplit(StringStripCR(GUICtrlRead($Edit1)), @LF)
For $i = 0 To UBound($Edititems[0])
            GUICtrlSetData($additionsLabel, $Edititems[$i])
Next
EndFunc

 

Share this post


Link to post
Share on other sites



#2 ·  Posted

Is it true that you have posted code? Yes

Is it true you have done so in English? Yes

Is it true that you have given us very little to go on to answer your question? Yes

Aside from this, how about a more thorough explanation of what you're after ;)


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

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

And then there was this.

#include <GUIConstantsEx.au3>

$Form1 = GUICreate("Form1", 158, 202)
$Edit1 = GUICtrlCreateEdit("", 8, 16, 137, 121)
GUICtrlSetData(-1, "Edit1" & @CRLF & "another")
$Label1 = GUICtrlCreateLabel("Total Number of Lines : ", 8, 160, 110, 17)
$additionsLabel = GUICtrlCreateLabel("", 120, 160, 36, 17)
GUISetState(@SW_SHOW)

While 1
    GUICtrlSetData($additionsLabel, StringSplit(GUICtrlRead($Edit1), @LF)[0]) ; This is true.
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

 

Edited by Malkey
StringStripCR() not really needed.
1 person likes this

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