Jump to content
Sign in to follow this  
Mack

MsgBox / GUI Prob.

Recommended Posts

Mack

#include <GUIConstants.au3>

GUICtrlCreateLabel ( "my label which will split on several lines", 10,20, 100, 100)
GUICreate("Test" ,300,173 ,$WS_EX_WINDOWEDGE)
GUICtrlCreatePic ("BG.jpg", 0, 0, 300, 173)
GUICtrlSetState (-1, $GUI_DISABLE)

GUISetState (@SW_SHOW)

$P = GUICtrlCreateButton ("Test", 5, 145 , 60)
if $P MsgBox("Test" , "Test")

; Run the GUI until the dialog is closed
While 1
   $Msg = GUIGetMsg()
   If $Msg = $GUI_EVENT_CLOSE Then ExitLoop
Wend

There is something wrong with this script, but what? :whistle:

Share this post


Link to post
Share on other sites
Valuater

more like this ???

#include <GUIConstants.au3>


GUICreate("Test" ,300,173 ,$WS_EX_WINDOWEDGE)
GUICtrlCreateLabel ( "my label which will split on several lines", 10,20, 100, 100)
GUICtrlCreatePic ("BG.jpg", 0, 0, 300, 173)
GUICtrlSetState (-1, $GUI_DISABLE)

GUISetState (@SW_SHOW)

$P = GUICtrlCreateButton ("Test", 5, 145 , 60)


; Run the GUI until the dialog is closed
While 1
    $Msg = GUIGetMsg()
   
    If $Msg = $P Then
    MsgBox(0,"Test" , "Test")
    EndIf
   
    If $Msg = $GUI_EVENT_CLOSE Then ExitLoop
Wend

hope that helps

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites
SmOke_N

Not that this has any relevance... but why would you set $P = GUICtrlCreateButton ("Test", 5, 145 , 60) after the GuiSetState()? Just like to see the button fly in :whistle: ?


Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites
Valuater

Not that this has any relevance... but why would you set $P = GUICtrlCreateButton ("Test", 5, 145 , 60) after the GuiSetState()?  Just like to see the button fly in :whistle: ?

<{POST_SNAPBACK}>

OOOPS... I missed that one

there were so many errors, i just kept testing until it worked

#include <GUIConstants.au3>


GUICreate("Test" ,300,173 ,$WS_EX_WINDOWEDGE)
GUICtrlCreateLabel ( "my label which will split on several lines", 10,20, 100, 100)
GUICtrlCreatePic ("BG.jpg", 0, 0, 300, 173)
GUICtrlSetState (-1, $GUI_DISABLE)
$P = GUICtrlCreateButton ("Test", 5, 145 , 60)
GUISetState (@SW_SHOW)

; Run the GUI until the dialog is closed
While 1
    $Msg = GUIGetMsg()
   
    If $Msg = $P Then
    MsgBox(0,"Test" , "Test")
    EndIf
   
    If $Msg = $GUI_EVENT_CLOSE Then ExitLoop
Wend

thx

8)


NEWHeader1.png

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  

×