Jump to content
Sign in to follow this  
mary

GUICtrlCreatePic and button click

Recommended Posts

mary

hi !

I dont know if is it bug or code mistake. my goal is to use GUICtrlCreatePic to load a jpg in all area of my main GUI (Form1) and place a button to be clickable. All is ok but my button seams to be not clickable. Here is my code :

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 471, 382, 192, 146, $WS_POPUP)
$Pic1 = GUICtrlCreatePic("d:\image.jpg", 8, 8, 441, 365)
$Button1 = GUICtrlCreateButton("Button1", 352, 336, 81, 25);, BitOR($BS_CENTER,$WS_BORDER,$WS_CLIPSIBLINGS))
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
  Case $GUI_EVENT_CLOSE
   Exit
   Case $Button1
   msgbox(1,1,"ok")

EndSwitch
WEnd

thanks for any help

Share this post


Link to post
Share on other sites
Fredinchy

Hi Mary, try disabling your image so you can click your button. Add this line after creating your picture:

GUICtrlSetState($Pic1,$GUI_DISABLE)

Cause no one here can ever stop us, they can try but we won't let them.. No way

Share this post


Link to post
Share on other sites
jlorenz1

This was my problem too. Thanks for your answer!


Johannes LorenzBensheim, Germanyjlorenz1@web.de[post="12602"]Highlightning AutoIt Syntax in Notepad++ - Just copy in your Profile/application data/notepad++[/post]

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  

×