Jump to content

icon button in GUI?


phew
 Share

Recommended Posts

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

Link to comment
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

Link to comment
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

Link to comment
Share on other sites

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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...