Tankbuster Posted March 23, 2011 Share Posted March 23, 2011 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 More sharing options...
Moderators Melba23 Posted March 23, 2011 Moderators Share Posted March 23, 2011 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 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 columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Andreik Posted March 23, 2011 Share Posted March 23, 2011 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 More sharing options...
Tankbuster Posted March 23, 2011 Author Share Posted March 23, 2011 Thank you, both.To be honest...why creating with the UDF?......ahhhh re-used some old code where I used once the $BS_BITMAP mmmh must be really dumb looking, didn't it? Maybe I should stop coding and go to bed to heal my flu.... Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now