Microsoft KB Archive/271877

= BUG: ToolTips Do Not Follow Controls on Scrollable Form =

Article ID: 271877

Article Last Modified on 10/22/2000

-

APPLIES TO


 * Microsoft Visual FoxPro 6.0 Professional Edition

-



This article was previously published under Q271877



SYMPTOMS
When you use ToolTips with a scrollable form under Visual FoxPro 6.0, the ToolTip positions are based upon their location at form instantiation rather than the currently visible window.



RESOLUTION
You can use the control's StatusBarText property to display ToolTip text in the status bar at the bottom of the Visual FoxPro window (assuming you have not turned off the screen).



STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.



Steps to Reproduce Behavior
  Paste the following code into a program file: PUBLIC loForm

loForm = NEWOBJECT(&quot;frmToolScroll&quot;) loForm.Show

RETURN

DEFINE CLASS frmToolScroll AS form
 * -- Form:        form1
 * -- ParentClass: form
 * -- BaseClass:   form
 * -- Time Stamp:  08/04/00 09:45:06 AM
 * -- Time Stamp:  08/04/00 09:45:06 AM

Top = 0 Left = 0 Height = 259 Width = 273 ScrollBars = 3 ShowTips = .F.  Caption = &quot;Scrolling Form&quot; Name = &quot;frmToolScroll&quot;

ADD OBJECT cmdAddControls AS commandbutton WITH ; Top = 10, ; Left = 10, ; Height = 31, ; Width = 130, ; Caption = &quot;Click to add controls&quot;, ; Name = &quot;cmdAddControls&quot;

PROCEDURE Load *!* some initialization WITH ThisForm .AutoCenter = .T.        .ShowTips = .T.         .Width = 300 .Height = 300 ENDwith ENDproc

PROCEDURE cmdAddControls.Click *!* lcAddControl can also be replaced with 'commandbutton' lcAddControl = 'label' lnStartX = 150 lnStartY = 150 *!* add five controls FOR i = 1 TO 5 *!* calculate new control's name lcAddControlName = lcAddControl + LTRIM(STR(i)) *!* add it        ThisForm.AddObject(lcAddControlName, lcAddControl) lcAddControlName = 'ThisForm.' + lcAddControlName WITH &lcAddControlName .BorderStyle = 1 .Caption = lcAddControl + LTRIM(STR(i)) .ToolTipText = .Caption *!* some added controls will not be visible initially, if           *!* starting from less than form's width & height .Left = lnStartX + i * 50 .Top = lnStartY + i * 50 *!* show it           .Visible = .T.         ENDwith ENDfor ThisForm.Refresh

*!* do it only once, or else 'controls already exists' error THIS.Enabled = .F.  ENDproc ENDdefine  Run the program, and click the Add Controls button. Hover the mouse over the visible labels, and note that the ToolTips appear. Scroll the form, hover the mouse over the controls that are now visible, and note that you do not see the ToolTips appear. Hover the mouse over the location where the visible labels were before you scrolled them, and note that the ToolTips appear.</ol>

Keywords: kbbug kbcodesnippet kbctrl kbpending KB271877

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.