Sign in to follow this  
Followers 0
CrewXp

Creating a text box (or label) when hovering over a gui button

2 posts in this topic

I'm trying to create a gui with image buttons. When a user hovers his mouse over the button, I want it to show a text area (explaining what the button does) along with the tooltop. I tried setting a msg to tooltip, but it doesn't work.

#include <GUIConstants.au3>

GUICreate("test",240,180)

$button1 = GUICtrlCreateButton ("1", 0,0,40,40,$BS_ICON)

GUICtrlSetImage (-1, "shell32.dll",5)

$button1tip = GUICtrlSetTip(-1,"Opens Today's File")

$button2 = GUICtrlCreateButton ("2", 40,00,40,40,$BS_ICON)

GUICtrlSetImage (-1, "shell32.dll",7)

$button3 = GUICtrlCreateButton ("3", 80,00,40,40,$BS_ICON)

GUICtrlSetImage (-1, "shell32.dll",22)

$button4 = GUICtrlCreateButton ("4", 120,0,40,40,$BS_ICON)

GUICtrlSetImage (-1, "shell32.dll",23)

$button5 = GUICtrlCreateButton ("5", 160,0,40,40,$BS_ICON)

GUICtrlSetImage (-1, "shell32.dll",32)

$buttonclose = GUICtrlCreateButton ("close", 200,0,40,40,$BS_ICON)

GUICtrlSetImage (-1, "shell32.dll",28)

GUISetState()

; Run the GUI until the dialog is closed

While 1

$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then ExitLoop

If $msg = $button1tip Then ExitLoop ;testing to see if it works (SUPPOSED TO CREATE A TEXT AREA IN THE GUI THAT GIVES A MORE EXPLAINATION OF WHAT IT DOES)

Wend

GUIDelete()

thx

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

i did it like this

When you mouse-over small portions of this map GUI, a smaller pic with a label over it will appear on top... there's about 8 different ones... looks real good too!

Posted Image

While 1
    $msg = GUIGetMsg()
    
    $pos = ""
    $pos=GUIGetCursorInfo()    
    If $pos[4] = 5 Then 
        GUIctrlSetState($prog_1_pic, $GUI_SHOW)
        GUIctrlSetState($prog_1_label, $GUI_SHOW)
        Do
            $msg1 = GUIGetMsg()
            If $msg1 = $Prog_1 Then MsgBox(64, " Item Creater"," Item Creater Program will now Run   "); call the function
            $pos1=GUIGetCursorInfo()    
            Sleep(100)
        Until $pos1[4] <> 5 
        GUIctrlSetState($prog_1_label, $GUI_HIDE)
        GUIctrlSetState($prog_1_pic, $GUI_HIDE)
    EndIf    
    
    If $pos[4] = 6 Then 
        GUIctrlSetState($prog_2_pic, $GUI_SHOW)
        GUIctrlSetState($prog_2_label, $GUI_SHOW)
        Do
            $msg1 = GUIGetMsg()
            If $msg1 = $Prog_2 Then MsgBox(64, " That Program"," That Program will now Run   "); call the function
            $pos1=GUIGetCursorInfo()    
            Sleep(100)
        Until $pos1[4] <> 6 
        GUIctrlSetState($prog_2_label, $GUI_HIDE)
        GUIctrlSetState($prog_2_pic, $GUI_HIDE)
    EndIf    
;;;;;;;;;;;;;................. more code

you really should see the whole thing... its pretty good!!!

http://www.xpcleanmenu.hostrocket.com/Autoit/WOW-Menu.exe

8)

Edited by Valuater

NEWHeader1.png

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