Sign in to follow this  
Followers 0
phew

icon button in GUI?

6 posts in this topic

hey,

i created a little gui and added an icon via guictrlcreateicon() to it. now i want to interact with this icon, ie. when i click on the icon then should pop up some msgbox(). how do i do that?

well my icon is a folder and i'd need it for FileOpenDialogue() but i have no clue how to detect a mouseclick that hit it!

greetings

Share this post


Link to post
Share on other sites



Like a normal button :P With GUIGetMsg()


*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Share this post


Link to post
Share on other sites

Like a normal button :P With GUIGetMsg()

is there no waii to use an icon/pic as button instead of creating a button by guictrlcreatebutton()?

Share this post


Link to post
Share on other sites

Cant't you read ^^ LIKE a button ... So you can use Icons:

$pic = GUICtrlCreateIcon...

$msg = GUIGetMsg()

If $msg = $pic Then ...


*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

You're overlooking what Andy said. You can detect a mouse click on ANY control the same way you would a button.

$Icon = guictrlcreateicon(...)

$msg = guigetmsg()

switch $msg
    case $Icon
      ; CODE HERE
endswitch

EDIT: Darn, beat me to it

Edited by JFee

Regards,Josh

Share this post


Link to post
Share on other sites

Cant't you read ^^ LIKE a button ... So you can use Icons:

$pic = GUICtrlCreateIcon...

$msg = GUIGetMsg()

If $msg = $pic Then ...

ahhhh sorry my bad!

nuff thanks :P

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