Jump to content
Sign in to follow this  
caramen

GUICtrlSetData

Recommended Posts

caramen

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

IUIAutomation From Junkew WebDriver From Danp2

 

Share this post


Link to post
Share on other sites
MikahS

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

 

Share this post


Link to post
Share on other sites
caramen

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?


IUIAutomation From Junkew WebDriver From Danp2

 

Share this post


Link to post
Share on other sites
MikahS

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

 

Share this post


Link to post
Share on other sites
czardas

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

Share this post


Link to post
Share on other sites
mikell

Except that I was too lazy to write the complete script  :)

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  

×