Jump to content

_GUICtrlButton_Create & GUICtrlSetTip


Recommended Posts

Hello,

I'm lost....

I created some buttons with

_GUICtrlButton_Create
to have a button with a bitmap.

But now I wanted to add tips, and GUICtrlSetTip does not work (at least in the example of the help file)

$btn = _GUICtrlButton_Create($hGUI, "Button1", 10, 10, 90, 50)
GUICtrlSetTip(-1,"Test")

I found some posts about "GUICtrlSetTip does not return ID", so I thought maybe with WM_NOTIFY but...

Let me explain want I search:

In case the mouse is over a button control created with _GUICtrlButton_Create I want to display at the control a sort of TIP/ToolTip/help line as long as the mouse is over the control/button.

I need a helping hand to point to the right way (posting?)

It makes me crazy because I know the solution is right in front of me, but I'm too blind... :)

(Or did I missed a thing about the GUICtrlSetTip?)

Link to comment
Share on other sites

  • Moderators

Tankbuster,

GUICtrlSetTip requires a ControlID as the ID parameter - this is returned by the native GUICtrlCreate* functions.

Creating a control with a UDF (using the _GUICtrl*_Create functions) returns a handle - which means that you cannot use this value in GUICtrlSetTip. :)

You say you created the button with the UDF to display a bitmap - you can show bitmaps on the natively-created buttons, which would solve your problem in one fell swoop. Why did you feel you needed UDF-created buttons? :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Example:

$MAIN = GUICreate("Example")
$BUTTON = GUICtrlCreateButton("",150,150,50,50,0x0080)  ; $BS_BITMAP = 0x0080
GUICtrlSetImage($BUTTON,@WindowsDir & "\Coffee Bean.bmp")
GUICtrlSetTip($BUTTON,"Cofee Bean")
GUISetState(@SW_SHOW,$MAIN)

While True
    Switch GUIGetMsg()
        Case -3
            Exit
    EndSwitch
    Sleep(10)
WEnd

When the words fail... music speaks.

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...