BUG: ToolTips Do Not Follow Controls on Scrollable Form (271877)



The information in this article applies to:

  • Microsoft Visual FoxPro for Windows 6.0

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.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Paste the following code into a program file:
    PUBLIC loForm
    
    loForm = NEWOBJECT("frmToolScroll")
    loForm.Show()
    
    RETURN
    
    **************************************************
    *-- Form:         form1
    *-- ParentClass:  form
    *-- BaseClass:    form
    *-- Time Stamp:   08/04/00 09:45:06 AM
    *
    DEFINE CLASS frmToolScroll AS form
    
       Top = 0
       Left = 0
       Height = 259
       Width = 273
       ScrollBars = 3
       ShowTips = .F.
       Caption = "Scrolling Form"
       Name = "frmToolScroll"
    
       ADD OBJECT cmdAddControls AS commandbutton WITH ;
          Top = 10, ;
          Left = 10, ;
          Height = 31, ;
          Width = 130, ;
          Caption = "Click to add controls", ;
          Name = "cmdAddControls"
    
       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
  2. Run the program, and click the Add Controls button.
  3. Hover the mouse over the visible labels, and note that the ToolTips appear.
  4. Scroll the form, hover the mouse over the controls that are now visible, and note that you do not see the ToolTips appear.
  5. Hover the mouse over the location where the visible labels were before you scrolled them, and note that the ToolTips appear.

Modification Type:MajorLast Reviewed:10/22/2000
Keywords:kbbug kbCodeSnippet kbCtrl kbDSupport KB271877 kbAudDeveloper