LPARAMETERS nButton, nShift, nXCoord, nYCoord =This.Parent.Parent.ShowToolTip(nButton, nShift, nXCoord, nYCoord, This.Parent.Text1.ToolTipText)Then in the grid
************************************************************************************** *- Name............: Grdimspgrid.Showtooltip *- Author..........: Will Jones *- Parameters......: None *- Return Value....: *- Description.....: *- Date............: 20/04/01 *- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - *- Modifications *- Date Made by Description *- ---------- ---------- ------------------------------------------------ *- 20/04/01 W Jones Initial Programming ************************************************************************************** lParameters nbutton, nshift, nxcoord, nycoord, tctooltip * Any buttons pressed? if so then do nothing If nbutton # 0 Return Endif * Does the label Exist on the form? if not then Add it If Not pemstatus(Thisform, "oToolTip",5) Thisform.AddObject('oToolTip',"lblToolTip") Endif With thisform * Only refresh the tooltip if it has a different caption * this stops the tooltip following the mouse around the grid header If .otooltip.Caption = Alltrim(tctooltip) ** Has user been over this control for >0.5 seconds? if so then show it If .otooltip.waittimer + 0.5 < seconds() .otooltip.Visible = !Empty(tctooltip) Else If nxCoord + .otooltip.width > Thisform.width && Thisform.Left+ .otooltip.left = thisform.Width-.otooltip.width && thisform.left+ Else .otooltip.Left = nxcoord Endif .otooltip.Top = MAX(nycoord - .otooltip.Height+35,0) && Shift the label down a bit so it doesn't cover the header Endif Else .otooltip.Visible = .F. .otooltip.AutoSize = .T. .otooltip.Caption = Alltrim(tctooltip) If .oTooltip.Left > Thisform.Width ** Form has been Resized If nxCoord + .otooltip.width > Thisform.width && Thisform.Left+ .otooltip.left = thisform.Width-.otooltip.width && thisform.left+ Else .otooltip.Left = nxcoord Endif Endif * does it need WordWrap? If .otooltip.Left + .otooltip.width => Thisform.Width .otooltip.wordWrap = .T. .otooltip.left = Thisform.Width -.otooltip.width Else .otooltip.wordWrap = .F. Endif * Turn autosize on after deciding if wordWrap is needed - this will set the vertical height .otooltip.AutoSize = .T. .otooltip.waittimer = Seconds() Endif .otooltip.Tag = Transform(Seconds()) If .otooltip.Left + .otooltip.width => Thisform.Width .otooltip.left = Thisform.Width -.otooltip.width Endif Endwith