Jump to content
Sign in to follow this  
darzanmihai

Need help - Push one button and react anotherone

Recommended Posts

darzanmihai

Lets say I have this code:

#include <GUIConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 350, 159, 378, 189)
$Button1 = GUICtrlCreateButton("Button1", 24, 64, 129, 25, 0)
$Button2 = GUICtrlCreateButton("Button2", 176, 64, 153, 25, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
        ;MsgBox(0,"","TEST")
        ;some code 
        Case $Button2
            tooltip("Button 2")

    EndSwitch
WEnd

What I want to do: when I push Button1 the $nMsg to capture a mesage coresponding to $Button2 so that the tooltip will apear ?

How could it be done? need example


I do not like stupid and idiot people that write idiot things...If you are one, do not write.

Share this post


Link to post
Share on other sites
Andreik

Lets say I have this code:

#include <GUIConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 350, 159, 378, 189)
$Button1 = GUICtrlCreateButton("Button1", 24, 64, 129, 25, 0)
$Button2 = GUICtrlCreateButton("Button2", 176, 64, 153, 25, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
    ;MsgBox(0,"","TEST")
    ;some code 
        Case $Button2
            tooltip("Button 2")

    EndSwitch
WEnd

What I want to do: when I push Button1 the $nMsg to capture a mesage coresponding to $Button2 so that the tooltip will apear ?

How could it be done? need example

Use ControlClick ().

When the words fail... music speaks

Share this post


Link to post
Share on other sites
darzanmihai

Use ControlClick ().

Thank you!

I do not like stupid and idiot people that write idiot things...If you are one, do not write.

Share this post


Link to post
Share on other sites
darzanmihai

Thank you!

But does not work if a Gui Child has focus, and I whant to send a click to a button from the parent GUI....

I have a Parent GUI that contains a TreeView, and a Child GUI.

When I push a button from the child GUI a want to send a click (or a msg) to a TreeViewItem from the Parent Gui. With sendind a click, doesn't work.


I do not like stupid and idiot people that write idiot things...If you are one, do not write.

Share this post


Link to post
Share on other sites
Andreik

Try to focus ControlFocus ()


When the words fail... music speaks

Share this post


Link to post
Share on other sites
darzanmihai

Try to focus ControlFocus ()

doesn't work...

maybe with: GUICtrlSendMsg ( controlID, msg , wParam, lParam ), but I do not know what values should have msg , wParam, lParam


I do not like stupid and idiot people that write idiot things...If you are one, do not write.

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  

×