Jump to content
Sign in to follow this  
Mohit

Need Help With GUICTRLCREATEPIC

Recommended Posts

Mohit

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

Share this post


Link to post
Share on other sites
wolf9228

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

صرح السماء كان هنا

 

Share this post


Link to post
Share on other sites
Mohit

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

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.