Jump to content

MsgBox / GUI Prob.


Mack
 Share

Recommended Posts

#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:

Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • Moderators

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.

Link to comment
Share on other sites

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

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...