Jump to content

Recommended Posts

Posted

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?)

  • Moderators
Posted

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:

  Reveal hidden contents

 

Posted

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
Posted

Thank you, both.

To be honest...why creating with the UDF?......ahhhh re-used some old code :) where I used once the $BS_BITMAP

:P mmmh must be really dumb looking, didn't it? Maybe I should stop coding and go to bed to heal my flu.... :)

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
  • Recently Browsing   0 members

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