Jump to content

GUICtrlSetData


Recommended Posts

Hello guys

i whant to setup a

GUICtrlSetData

2 time

and make it in the same input box without erasing the first data

how to explain better...

I got one input box EMPTY

[ ]

If i push buttom 1

it set the input box like this

[A]

if i push buttom 2 also after 1

(BUT BUTTOM B SEND ONLY THE LETTER B .... )

Actualy B is erazing A

 

i whant

[AB]

 

I tryed this

Then GUICtrlSetData($Listen,$Listen & 'B')

dont work... any help ?

Edited by caramen

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Link to comment
Share on other sites

If you take a look at the helpfile; Using:

GUICtrlSetData

will replace the text. I would try using this instead of the second call to GUICtrlSetData:

#include <GuiListBox.au3>
_GUICtrlListBox_InsertString($Listen, 'B', 0)

Give that a try and see if that is any help.

Edited by MikahS

Snips & Scripts


My Snips: graphCPUTemp ~ getENVvars
My Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4

Feel free to use any of my code for your own use.                                                                                                                                                           Forum FAQ

 

Link to comment
Share on other sites

If you take a look at the helpfile; Using:

GUICtrlSetData

will replace the text. I would try using this instead of the second call to GUICtrlSetData:

#include <GuiListBox.au3>
_GUICtrlListBox_InsertString($Listen, 'B', 0)

Give that a try and see if that is any help.

I am not sure this is possible becose if i use Buttom B first that wont work

there is 15 buttom possible so i need to hit any of them without erase anything ... any other solution?

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Link to comment
Share on other sites

I am not sure this is possible becose if i use Buttom B first that wont work

there is 15 buttom possible so i need to hit any of them without erase anything ... any other solution?

Make input box start with

" "

EDIT: if this does not help; I'm thinking posting your code will help us give you a better solution.

Edited by MikahS

Snips & Scripts


My Snips: graphCPUTemp ~ getENVvars
My Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4

Feel free to use any of my code for your own use.                                                                                                                                                           Forum FAQ

 

Link to comment
Share on other sites

$oldtext = GuiCtrlRead($input)
GuiCtrlSetData($input, $oldtext & $newtext)

Nice one . i am trying right now and come back to you guys :)

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Link to comment
Share on other sites

Exactly what Mikell said (beat me to it):

;

#include <GUIConstantsEx.au3>

Global $hGUI = GUICreate("test", 200, 100)
Global $hInput = GUICtrlCreateInput("",10,10,180,20)
Global $hBtnA = GUICtrlCreateButton("A", 10, 40, 40)
Global $hBtnB = GUICtrlCreateButton("B", 60, 40, 40)

GUISetState(@SW_SHOW)

Global $msg, $sEditContents
While 1
    $msg = GUIGetMsg()
    If $msg = $GUI_EVENT_CLOSE Then
        ExitLoop
    ElseIf $msg = $hBtnA Then
        $sEditContents = GUICtrlRead($hInput) ; Read the contents of the input control
        GUICtrlSetData($hInput, $sEditContents & "A") ; Concatenate A
    ElseIf $msg = $hBtnB Then
        $sEditContents = GUICtrlRead($hInput) ; Read the contents of the input control
        GUICtrlSetData($hInput, $sEditContents & "B") ; Concatenate B
    EndIf
WEnd

;

Edit - spelling.

Edited by czardas
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...