firststep 0 Posted January 17, 2012 hello all, i have a problem and hope somebody can help me, im new in Auto It, i make 3 button, the first one, i like to show a message in mess box, and already ok, but the other buttons, i like to show picture in mess box too, or a pop up picture, so after ok, the program doesnt exit, but it failed ... need a light, thanx ) sorry if the question so newbie ... THANX BE4 MYFUNC() Func MYFUNC() $font = "Comic Sans MS" GUICreate("APLIKASI XXX ",800,600) GUICtrlCreateLabel("BLA BLA BLA", 400,5,210,30) GUICtrlSetFont(-1, 15, 500, 4, $font) GUICtrlSetBkColor(-1, 0x00ff00) $A = GUICtrlCreateButton("STRT", 330, 40, 70,20) $B = GUICtrlCreateButton("B", 330, 70, 70,20) $C = GUICtrlCreateButton("C", 430, 70, 70,20) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $A MsgBox(8192, "Box Info", "MESSAGE FOR REMIND THE TASK" ) Case $msg = $B GUICtrlCreatePic((@ScriptDir & '\TIGER.JPG')) Case $msg = $C FileOpen(@ScriptDir & '\TIGER.JPG') EndSelect WEnd EndFunc ;==>Example Share this post Link to post Share on other sites
sleepydvdr 8 Posted January 17, 2012 (edited) Add this line before GUISetState() $Pic1 = GUICtrlCreatePic("tiger.jpg", 144, 104, 516, 480) Also, the picture is too large for your GUI. You would benefit from resizing it and inserting it as it's actual size. Edited January 17, 2012 by sleepydvdr #include <ByteMe.au3> Share this post Link to post Share on other sites
firststep 0 Posted January 17, 2012 thanx for your input, yes with that the pic will show, but what if i want the pic show after we click the button 'B' or 'C' and after that it can hide, like pop up? any idea .... because i like to make many buttons that if u click can show different pic .... THANX again ... waiting for enlightment ... Share this post Link to post Share on other sites
sleepydvdr 8 Posted January 17, 2012 (edited) Below is an example that works for the "B" button:expandcollapse popup#include <guiconstants.au3> MYFUNC() Func MYFUNC() $font = "Comic Sans MS" GUICreate("APLIKASI XXX ", 800, 600) GUICtrlCreateLabel("BLA BLA BLA", 400, 5, 210, 30) GUICtrlSetFont(-1, 15, 500, 4, $font) GUICtrlSetBkColor(-1, 0x00ff00) $A = GUICtrlCreateButton("STRT", 330, 40, 70, 20) $B = GUICtrlCreateButton("B", 330, 70, 70, 20) $C = GUICtrlCreateButton("C", 430, 70, 70, 20) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $A MsgBox(8192, "Box Info", "MESSAGE FOR REMIND THE TASK") Case $msg = $B _ShowPicture() Case $msg = $C FileOpen(@ScriptDir & 'TIGER.JPG') EndSelect WEnd EndFunc ;==>MYFUNC Func _ShowPicture() $gui2 = GUICreate("Form1", 553, 573) $Pic1 = GUICtrlCreatePic("tiger.jpg", 0, 0, 550, 570) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE GUIDelete($gui2) ExitLoop EndSwitch WEnd EndFunc ;==>_ShowPictureEdit: The function you are looking for on the "C" button is ShellExecute. Edited January 17, 2012 by sleepydvdr #include <ByteMe.au3> Share this post Link to post Share on other sites
firststep 0 Posted January 17, 2012 waWWWWW thanx a lot, this is what i want, thanx very MucH, for the 'B' button, i will make it abou 50 button, HohOHoho ... this is an enlightment im looking for, thanx again .... bro sleepydvdr Share this post Link to post Share on other sites