Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can a tooltip be programmatically shown?
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00848285
Message ID:
00848359
Views:
13
Here is a method that I use to display a wait window above a control.
*** This method displays a Wait Window containing tcMessage, just above toObject.
***   Include .T. for tlClear or tlWait if you want to clear the message or wait for a key press.
***  Examples from text box Valid methods:
***		THISFORM.WaitWindow("Note: Division has also been reset. Tap any key to continue.", THIS, .T., .T.)
***		THISFORM.WaitWindow("Please enter an Estimate greater than or equal to zero.", THIS)

LPARAMETERS tcMessage, toObject, tlClear, tlWait

IF TYPE("toObject") <> "O"		&& Use the default object
	toObject = THISFORM.pgfTaskSubTask.pagTask.pgfTask.pagLocate.txtTaskNum
ENDIF

IF ! tlClear
	tcClear = "NOCLEAR"
ELSE
	tcClear = ""
ENDIF
IF ! tlWait
	tcWait = "NOWAIT"
ELSE
	tcWait = ""
ENDIF

TitleHeight = SYSMETRIC(9 )
FrameHeight = SYSMETRIC(11)
MenuHeight = SYSMETRIC(20)
ScreenRows = SROWS()
PixelsPerRow = _SCREEN.HEIGHT / ScreenRows

*** All objects on this form are enclosed in 2 page frames, that is the reason for the parent.parent
*** This needs to be changed to automatically search for parents.  SOMEDAY!
RowStartPixel =  _SCREEN.TOP + THISFORM.TOP +  toObject.TOP + toObject.PARENT.PARENT.TOP + ;
	toObject.PARENT.PARENT.PARENT.PARENT.TOP + 2 * FrameHeight +  MenuHeight + 3 * TitleHeight
lnRow = RowStartPixel / PixelsPerRow

FrameWidth = SYSMETRIC(10)
ScreenCols = SCOLS()
PixelsPerColumn = _SCREEN.WIDTH / ScreenCols
ScreenWidth = SYSMETRIC(1)
MessageWidth = THISFORM.TEXTWIDTH(tcMessage)
ColumnStartPixel = _SCREEN.LEFT + THISFORM.LEFT +  toObject.LEFT + toObject.PARENT.PARENT.LEFT ;
	+ toObject.PARENT.PARENT.PARENT.PARENT.LEFT +  2 * FrameWidth
IF MessageWidth + ColumnStartPixel  > ScreenWidth
	ColumnStartPixel  = ColumnStartPixel - MessageWidth + toObject.WIDTH
ENDIF
lnCol = ColumnStartPixel / PixelsPerColumn

*** Adding 1 to the row and column makes it display in the right location????
****WAIT tcMessage WINDOW AT lnRow + 1, lnCol + 1 &tcWait &tcClear
WAIT tcMessage WINDOW AT lnRow + 0.5, lnCol + 1.0 &tcWait &tcClear
>>Does anyone know if/how to programatically show a control's tooltip?
>>
>>What I'd like to do is display a valid range for a textbox that will receive numeric input. I don't like the wait window command since I can't position it exactly where I need it (near the control). I thought that if I could fire an event to show the range in the control's tooltip it would be a better solution.
>>
>>Any thoughts or ideas are appreciated.
>>
>>TIA
>>
>Mike,
>
>There're a bunch of Tootip classes in the download area. You should be able to use one of them.
Dennis Lindeman
Previous
Reply
Map
View

Click here to load this message in the networking platform