Sign in to follow this  
Followers 0
alansch64

How to send data to the MainGui Caption ?

3 posts in this topic

Hello,

This is my first post. I've been around the forum for sometime and it REALLY help me alot in lots of situations.

Thanks to you all !

Now I feel like I'm stupidly stuck and couldn't find a solution.

The title mainly says it all.

I'm willing to send data to the MainGui Caption throug an action button and I would like it to show off instantly.

Here's a simple example of what I'm trying to do

#include <GUIConstants.au3>

$Form2 = GUICreate("TEST", 309, 219, 303, 219)
$Button1 = GUICtrlCreateButton("Button1", 90, 132, 133, 67, 0)
$Label1 = GUICtrlCreateLabel("Label1", 108, 48, 84, 23)
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Select
        Case $nmsg = $GUI_EVENT_CLOSE
            Exit
        Case $nMsg=$Button1 
            GUICtrlSetData($Form2,"NEWLABEL")
            GUICtrlSetData($Label1,"NEWLABEL")
    EndSelect
WEnd

The GUICtrlSetData command works fine in sending data to $Label1 , but will not work with $Form2.

Is it possible ?

Any ideas to push me in right direction ?

Thanks

Share this post


Link to post
Share on other sites



Hello,

This is my first post. I've been around the forum for sometime and it REALLY help me alot in lots of situations.

Thanks to you all !

Now I feel like I'm stupidly stuck and couldn't find a solution.

The title mainly says it all.

I'm willing to send data to the MainGui Caption throug an action button and I would like it to show off instantly.

Here's a simple example of what I'm trying to do

#include <GUIConstants.au3>

$Form2 = GUICreate("TEST", 309, 219, 303, 219)
$Button1 = GUICtrlCreateButton("Button1", 90, 132, 133, 67, 0)
$Label1 = GUICtrlCreateLabel("Label1", 108, 48, 84, 23)
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Select
        Case $nmsg = $GUI_EVENT_CLOSE
            Exit
        Case $nMsg=$Button1 
            GUICtrlSetData($Form2,"NEWLABEL")
            GUICtrlSetData($Label1,"NEWLABEL")
    EndSelect
WEnd

The GUICtrlSetData command works fine in sending data to $Label1 , but will not work with $Form2.

Is it possible ?

Any ideas to push me in right direction ?

Thanks

WinSetTitle()

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

Excellent !

Thanks Georges.

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  
Followers 0