Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How To Pop Up The ToolTipText
Message
From
04/03/2006 00:36:12
 
 
To
03/03/2006 17:38:35
Cindy Winegarden
Duke University Medical Center
Durham, North Carolina, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01101293
Message ID:
01101472
Views:
24
>>Is there any way to force the tooltip text to display on command?
>
>Hi Kevin,
>
>I don't think there is a way, but you might try the Fancy Tooltip class as a substitute. See download #9301 .

Here is a simple way, with much, much, less code (less-fancy). This can easily be converted into a custom class that ca be dropped on a form. You also need to put a little code into each control's "MouseMove" and "MouseLeave" events. I tested this on a form with the included cmdShowTips.Click code shown below.
**********************************************************************
* Name:	TestForm.Init() Event()	Event
* Author: JXE 2006/03/03
* Description:	Initialization of this form.
***********************************************************
***---| Put This in your Form's "Init Event" or put it in a custom class
***---| That you can drag-n-drop on your form subclasses.
***---| Customize it further, as you wish.

Thisform.AddObject("lblCoolTipText", "label")
WITH Thisform.lblCoolTipText
	.AutoSize =		.T.
	.BackColor =	RGB(0, 0, 0)
	.BackStyle =	1					&&---| 1 - Opaque (Default)
	.BorderStyle =	1					&&---| 1 - Fixed Single
	.Caption =		''
	***.FontBold =		.T.
	.FontName =		'FoxFont'
	.ForeColor =	RGB(255, 255, 0)
	.Left =			0
	.Top =			0
	.Visible =		.F.
	.Width =		190
	.WordWrap =		.T.
ENDWITH

**********************************************************************
* Name:	TestForm.cmd1stFile.MouseMove()	Event
* Author: JXE 2006/03/03
* Description:	Mouse has MOVED-OVER this command button.
***********************************************************
LPARAMETERS nButton, nShift, nXCoord, nYCoord

***---| The following can be added to your controls at
***---| the subclass level or wherever you need it.
WITH Thisform.lblCoolTipText
	IF .Visible = .F.
		IF !EMPTY(This.ToolTipText)
			This.ToolTipText = ''
		ENDIF

		.Caption = 'Is this a WINNER? This has automatic wordwrap features, too'
		IF !EMPTY(nXCoord) AND !EMPTY(nYCoord)
			.Left = nXCoord + 5
			.Top =  nYCoord + 5
		ELSE
			.Left = (This.Left + This.Width) - 3
			.Top =  (This.Top + This.Height) - 3
		ENDIF
		.Visible = .T.
	ENDIF
ENDWITH

**********************************************************************
* Name:	TestForm.cmd1stFile.MouseLeave()	Event
* Author: JXE 2006/03/03
* Description:	Mouse has MOVED-OFF this command button.
***********************************************************
LPARAMETERS nButton, nShift, nXCoord, nYCoord

Thisform.lblCoolTipText.Visible = .F.

**********************************************************************
* Name:	TestForm.cmdShowTips.Click()	Event
* Author: JXE 2006/03/03
* Description:	Show/Hide, your custom ToolTips.
***********************************************************
IF This.Caption = "\<Show ToolTips"
	This.Caption = "\<Hide ToolTips"
	Thisform.cmd1stFile.MouseMove()
ELSE
	This.Caption = "\<Show ToolTips"
	Thisform.cmd1stFile.MouseLeave()
ENDIF
- justamistere, a mystery, Mister-E.
Previous
Reply
Map
View

Click here to load this message in the networking platform