Jump to content
Sign in to follow this  
Mohit

Need Help With GUICTRLCREATEPIC

Recommended Posts

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

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

#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  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...