Sign in to follow this  
Followers 0
maxrealqnx

If you have two windows, How to change picture ?

4 posts in this topic

#1 ·  Posted (edited)

If have two windows, how can I change picture of the first window without delete the second window ? Thank you in advance for your answers. Best regards :D

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <StaticConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 500, 500, 302, 218)
$Pic1 = GUICtrlCreatePic("C:\Program Files\AutoIt3\Examples\ExtrasAutoIt.bmp", 0, 0, 0, 0, $SS_BITMAP)
GUISetState(@SW_SHOW, $Form1)
$Form2 = GUICreate("Form2", 500, 500, 302, 218)
$Pic2 = GUICtrlCreatePic("C:\Program Files\AutoIt3\Examples\ExtrasLogo.bmp", 0, 0, 0, 0, $SS_BITMAP)
WinSetOnTop("Form2", "", 1)
GUISetState(@SW_SHOW, $Form2)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
  Case $GUI_EVENT_CLOSE
   ;GUISetState($Form2, @SW_DISABLE)
   ;WinSetOnTop("Form2", "", 0)
   GUICtrlDelete ($Pic1)
   $Pic1 = GUICtrlCreatePic("C:\Program Files\AutoIt3\Examples\ExtrasTech.bmp", 0, 0, 0, 0, $SS_BITMAP)
   MsgBox (0, "", "Form1 picture changed :)")
   Exit
EndSwitch
WEnd
Edited by maxrealqnx

Share this post


Link to post
Share on other sites



Insert GUISwitch($Form1) after GUICtrlDelete ($Pic1)

1 person likes this

Share this post


Link to post
Share on other sites

Insert GUISwitch($Form1) after GUICtrlDelete ($Pic1)

Thank you very much for your quick reply. God bless you. Best regards :D

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  
Followers 0