Jump to content

Button And Picture


Recommended Posts

hi,

how do i get this to work

when i click on the button with the text test, it does nothing

can someone help?

#include<GUIConstants.au3>

Opt("GUICloseOnESC",1)
Opt("GUIOnEventMode", 1)
Opt("RunErrorsFatal", 0)
Opt("TrayAutoPause", 0)
Opt("TrayOnEventMode", 1)
Opt("TrayMenuMode",1)
Opt("OnExitFunc", "close")

GUICreate("my proggie",600,400)

$tray_start = TrayCreateItem("Start")
TrayItemSetOnEvent($tray_start,"close")
$tray_status = TrayCreateItem("Status")
TrayItemSetOnEvent($tray_status,"close")
$tray_instellingen = TrayCreateItem("Instellingen")
TrayItemSetOnEvent($tray_instellingen,"close")
$tray_afsluiten = TrayCreateItem("Afsluiten")
TrayItemSetOnEvent($tray_afsluiten,"close")
TraySetIcon("Clean XP Pro.ico")


GUISetBkColor(0xFFFFFF)
GUISetIcon("icon.ico")
GUICtrlCreatePic("balk1.jpg",0,0,600,100)
$help = GUICtrlCreatePic("balk2.jpg",0,350,600,50)
GUICtrlCreatePic("balk3.jpg",575,100,25,250)
GUICtrlCreatePic("balk3.jpg",0,100,25,250)
GUICtrlCreatePic("balk4.jpg",300 - 154,60,308,40)
GUISetOnEvent($GUI_EVENT_CLOSE, "close")


$btn_start = GUICtrlCreateButton("test",200,375)
GUICtrlSetOnEvent($btn_start,"test")

GUISetState(@SW_SHOW)

While 1
    
WEnd

Func test()
    MsgBox(0,"","")
EndFunc

Func close()
    Exit
EndFunc

Arjan

Link to comment
Share on other sites

  • Moderators

It goes to the msgbox() in test() for me, but then I don't have your pictures either. If you comment the pictures out, what happens?

Edit:

Try giving each of your GUICtrlCreatPic()'s a variable name, then before you call GUISetState(), disable them.

Edited by SmOke_N

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

the pictures are the problem, the script works fine without the picture but not with the pictures.

i think it has something to do with the syles or something.

Arjan

Link to comment
Share on other sites

thanks Valuater

i'll do that

but the problem isn't resolved...

Arjan

Edited by arjan staring
Link to comment
Share on other sites

  • Moderators

The sleep is definately an issue with CPU usage, but not the issue your having with your pictures, take a look at my edit above, and use the disable method for your pictures.

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

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