Mohit Posted September 28, 2010 Share Posted September 28, 2010 See i created a pic with this control. But i want to update the pic with other pic when i press the other buttons that i created..... Link to comment Share on other sites More sharing options...
wolf9228 Posted September 28, 2010 Share Posted September 28, 2010 See i created a pic with this control. But i want to update the pic with other pic when i press the other buttons that i created..... #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> GUICreate("My GUI picture", 350, 300, -1, -1, $WS_SIZEBOX + $WS_SYSMENU) $Button_1 = GUICtrlCreateButton("Update", 10, 10, 100,40) $CtrlId = GUICtrlCreatePic("C:\Image1.bmp", 70, 100, 200, 50) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Button_1 UpdatePicCtrl($CtrlId,"C:\Image2.bmp", 70, 150, 200, 50) EndSelect WEnd Func UpdatePicCtrl($CtrlId,$ImageFileName,$left,$top ,$width ,$height ) GUICtrlSetPos ($CtrlId, $left,$top ,$width ,$height ) GUICtrlSetImage ($CtrlId,$ImageFileName) EndFunc صرح السماء كان هنا Link to comment Share on other sites More sharing options...
Mohit Posted September 28, 2010 Author Share Posted September 28, 2010 #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> GUICreate("My GUI picture", 350, 300, -1, -1, $WS_SIZEBOX + $WS_SYSMENU) $Button_1 = GUICtrlCreateButton("Update", 10, 10, 100,40) $CtrlId = GUICtrlCreatePic("C:\Image1.bmp", 70, 100, 200, 50) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Button_1 UpdatePicCtrl($CtrlId,"C:\Image2.bmp", 70, 150, 200, 50) EndSelect WEnd Func UpdatePicCtrl($CtrlId,$ImageFileName,$left,$top ,$width ,$height ) GUICtrlSetPos ($CtrlId, $left,$top ,$width ,$height ) GUICtrlSetImage ($CtrlId,$ImageFileName) EndFunc I will try that..... Link to comment Share on other sites More sharing options...
Mohit Posted September 29, 2010 Author Share Posted September 29, 2010 this doesn't work pls help. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now