Microsoft KB Archive/171348: Difference between revisions

From BetaArchive Wiki
(importing KB archive)
 
m (Text replacement - "&" to "&")
 
(One intermediate revision by the same user not shown)
Line 63: Line 63:
=== Steps to Reproduce Behavior ===
=== Steps to Reproduce Behavior ===


The following program illustrates the behavior of the TabStrip control during runtime. When you execute the program, an "Insert Object" prompt appears. Select "Insert Control" and locate, or add, the "Microsoft TabStrip Control, version 5.0." When the form runs, a TextBox should be on the TabStrip Control but actually is behind the TabStrip control. Click on the "Place Textbox on Shape" command button to move the TextBox to the Shape. The two command buttons on the form change the location of the TextBox and also changes the ZORDER. When the TextBox is in the area of the TabStrip control it does not appear on top of the TabStrip control:
The following program illustrates the behavior of the TabStrip control during runtime. When you execute the program, an "Insert Object" prompt appears. Select "Insert Control" and locate, or add, the "Microsoft TabStrip Control, version 5.0." When the form runs, a TextBox should be on the TabStrip Control but actually is behind the TabStrip control. Click on the "Place Textbox on Shape" command button to move the TextBox to the Shape. The two command buttons on the form change the location of the TextBox and also changes the ZORDER. When the TextBox is in the area of the TabStrip control it does not appear on top of the TabStrip control:
<pre class="codesample">  **Start of Program
<pre class="codesample">  **Start of Program
   frmTabStrip = CREATEOBJECT(&quot;tabstrip&quot;)
   frmTabStrip = CREATEOBJECT("tabstrip")
   frmTabStrip.SHOW(1)
   frmTabStrip.SHOW(1)
   **************************************************
   **************************************************
Line 75: Line 75:
       WIDTH = 335
       WIDTH = 335
       DOCREATE = .T.
       DOCREATE = .T.
       CAPTION = &quot;TabStrip Example&quot;
       CAPTION = "TabStrip Example"
       NAME = &quot;Form1&quot;
       NAME = "Form1"
       ADD OBJECT olecontrol1 AS OLECONTROL WITH ;
       ADD OBJECT olecontrol1 AS OLECONTROL WITH ;
           TOP = 24, ;
           TOP = 24, ;
Line 82: Line 82:
           HEIGHT = 132, ;
           HEIGHT = 132, ;
           WIDTH = 288, ;
           WIDTH = 288, ;
           NAME = &quot;Olecontrol1&quot;
           NAME = "Olecontrol1"
       ADD OBJECT txtText1 AS TEXTBOX WITH ;
       ADD OBJECT txtText1 AS TEXTBOX WITH ;
           HEIGHT = 60, ;
           HEIGHT = 60, ;
Line 88: Line 88:
           TOP = 72, ;
           TOP = 72, ;
           WIDTH = 252, ;
           WIDTH = 252, ;
           NAME = &quot;txtText1&quot;
           NAME = "txtText1"
       ADD OBJECT shape1 AS SHAPE WITH ;
       ADD OBJECT shape1 AS SHAPE WITH ;
           TOP = 168, ;
           TOP = 168, ;
Line 94: Line 94:
           HEIGHT = 97, ;
           HEIGHT = 97, ;
           WIDTH = 288, ;
           WIDTH = 288, ;
           NAME = &quot;Shape1&quot;
           NAME = "Shape1"
       ADD OBJECT cmdCommand1 AS COMMANDBUTTON WITH ;
       ADD OBJECT cmdCommand1 AS COMMANDBUTTON WITH ;
           TOP = 288, ;
           TOP = 288, ;
Line 100: Line 100:
           HEIGHT = 25, ;
           HEIGHT = 25, ;
           WIDTH = 132, ;
           WIDTH = 132, ;
           CAPTION = &quot;Send Textbox to Front&quot;, ;
           CAPTION = "Send Textbox to Front", ;
           NAME = &quot;cmdCommand1&quot;
           NAME = "cmdCommand1"
       ADD OBJECT cmdCommand2 AS COMMANDBUTTON WITH ;
       ADD OBJECT cmdCommand2 AS COMMANDBUTTON WITH ;
           TOP = 288, ;
           TOP = 288, ;
Line 107: Line 107:
           HEIGHT = 25, ;
           HEIGHT = 25, ;
           WIDTH = 157, ;
           WIDTH = 157, ;
           CAPTION = &quot;Place Textbox on Shape&quot;, ;
           CAPTION = "Place Textbox on Shape", ;
           NAME = &quot;cmdCommand2&quot;
           NAME = "cmdCommand2"
       ADD OBJECT label1 AS LABEL WITH ;
       ADD OBJECT label1 AS LABEL WITH ;
           FONTBOLD = .T., ;
           FONTBOLD = .T., ;
           CAPTION = &quot;Shape&quot;, ;
           CAPTION = "Shape", ;
           HEIGHT = 20, ;
           HEIGHT = 20, ;
           LEFT = 38, ;
           LEFT = 38, ;
           TOP = 172, ;
           TOP = 172, ;
           WIDTH = 61, ;
           WIDTH = 61, ;
           NAME = &quot;Label1&quot;
           NAME = "Label1"


       PROCEDURE cmdCommand1.CLICK
       PROCEDURE cmdCommand1.CLICK
           IF THIS.CAPTION = &quot;Send Textbox to Front&quot;
           IF THIS.CAPTION = "Send Textbox to Front"
               THISFORM.txtText1.ZORDER(0) &amp;&amp; Send to front
               THISFORM.txtText1.ZORDER(0) && Send to front
               THIS.CAPTION = &quot;Send Textbox to Back&quot;
               THIS.CAPTION = "Send Textbox to Back"
           ELSE
           ELSE
               THISFORM.txtText1.ZORDER(1) &amp;&amp; Send to back
               THISFORM.txtText1.ZORDER(1) && Send to back
               THIS.CAPTION = &quot;Send Textbox to Front&quot;
               THIS.CAPTION = "Send Textbox to Front"
           ENDIF
           ENDIF
       ENDPROC
       ENDPROC
       PROCEDURE cmdCommand2.CLICK
       PROCEDURE cmdCommand2.CLICK
           IF THIS.CAPTION = &quot;Place Textbox on Shape&quot;
           IF THIS.CAPTION = "Place Textbox on Shape"
               THISFORM.txtText1.TOP = 192
               THISFORM.txtText1.TOP = 192
               THISFORM.txtText1.ZORDER(0) &amp;&amp; Send to front
               THISFORM.txtText1.ZORDER(0) && Send to front
               THIS.CAPTION = &quot;Place Textbox on TabStrip&quot;
               THIS.CAPTION = "Place Textbox on TabStrip"
               THISFORM.cmdCommand1.CAPTION = &quot;Send Textbox to Back&quot;
               THISFORM.cmdCommand1.CAPTION = "Send Textbox to Back"
           ELSE
           ELSE
               THISFORM.txtText1.TOP = 72
               THISFORM.txtText1.TOP = 72
               THIS.CAPTION = &quot;Place Textbox on Shape&quot;
               THIS.CAPTION = "Place Textbox on Shape"
           ENDIF
           ENDIF
       ENDPROC
       ENDPROC

Latest revision as of 12:29, 21 July 2020

Article ID: 171348

Article Last Modified on 12/11/1999



APPLIES TO

  • Microsoft Visual FoxPro 5.0 Standard Edition
  • Microsoft Visual FoxPro 5.0a
  • Microsoft Visual FoxPro 6.0 Professional Edition



This article was previously published under Q171348

SYMPTOMS

In Visual FoxPro 5.0, the TabStrip Control can have objects placed in front of it during design mode but the objects go behind the TabStrip control during runtime. Changing the ZORDER of either the TabStrip control, or the controls placed on the TabStrip control, has no effect on the controls during runtime.

STATUS

This behavior is by design.

MORE INFORMATION

A TabStrip control is an ActiveX control that is like the dividers in a notebook or the labels on a group of file folders. By using a TabStrip control, you can define multiple pages for the same area of a window or dialog box in your application. The TabStrip control is similar to the tabs on the PageFrame or Tabbed Dialog control.

Steps to Reproduce Behavior

The following program illustrates the behavior of the TabStrip control during runtime. When you execute the program, an "Insert Object" prompt appears. Select "Insert Control" and locate, or add, the "Microsoft TabStrip Control, version 5.0." When the form runs, a TextBox should be on the TabStrip Control but actually is behind the TabStrip control. Click on the "Place Textbox on Shape" command button to move the TextBox to the Shape. The two command buttons on the form change the location of the TextBox and also changes the ZORDER. When the TextBox is in the area of the TabStrip control it does not appear on top of the TabStrip control:

   **Start of Program
   frmTabStrip = CREATEOBJECT("tabstrip")
   frmTabStrip.SHOW(1)
   **************************************************
   *-- StartDefine: tabstrip
   DEFINE CLASS tabstrip AS FORM
       TOP = 5
       LEFT = 51
       HEIGHT = 338
       WIDTH = 335
       DOCREATE = .T.
       CAPTION = "TabStrip Example"
       NAME = "Form1"
       ADD OBJECT olecontrol1 AS OLECONTROL WITH ;
           TOP = 24, ;
           LEFT = 24, ;
           HEIGHT = 132, ;
           WIDTH = 288, ;
           NAME = "Olecontrol1"
       ADD OBJECT txtText1 AS TEXTBOX WITH ;
           HEIGHT = 60, ;
           LEFT = 36, ;
           TOP = 72, ;
           WIDTH = 252, ;
           NAME = "txtText1"
       ADD OBJECT shape1 AS SHAPE WITH ;
           TOP = 168, ;
           LEFT = 24, ;
           HEIGHT = 97, ;
           WIDTH = 288, ;
           NAME = "Shape1"
       ADD OBJECT cmdCommand1 AS COMMANDBUTTON WITH ;
           TOP = 288, ;
           LEFT = 24, ;
           HEIGHT = 25, ;
           WIDTH = 132, ;
           CAPTION = "Send Textbox to Front", ;
           NAME = "cmdCommand1"
       ADD OBJECT cmdCommand2 AS COMMANDBUTTON WITH ;
           TOP = 288, ;
           LEFT = 156, ;
           HEIGHT = 25, ;
           WIDTH = 157, ;
           CAPTION = "Place Textbox on Shape", ;
           NAME = "cmdCommand2"
       ADD OBJECT label1 AS LABEL WITH ;
           FONTBOLD = .T., ;
           CAPTION = "Shape", ;
           HEIGHT = 20, ;
           LEFT = 38, ;
           TOP = 172, ;
           WIDTH = 61, ;
           NAME = "Label1"

       PROCEDURE cmdCommand1.CLICK
           IF THIS.CAPTION = "Send Textbox to Front"
               THISFORM.txtText1.ZORDER(0) && Send to front
               THIS.CAPTION = "Send Textbox to Back"
           ELSE
               THISFORM.txtText1.ZORDER(1) && Send to back
               THIS.CAPTION = "Send Textbox to Front"
           ENDIF
       ENDPROC
       PROCEDURE cmdCommand2.CLICK
           IF THIS.CAPTION = "Place Textbox on Shape"
               THISFORM.txtText1.TOP = 192
               THISFORM.txtText1.ZORDER(0) && Send to front
               THIS.CAPTION = "Place Textbox on TabStrip"
               THISFORM.cmdCommand1.CAPTION = "Send Textbox to Back"
           ELSE
               THISFORM.txtText1.TOP = 72
               THIS.CAPTION = "Place Textbox on Shape"
           ENDIF
       ENDPROC
   ENDDEFINE
   *-- EndDefine: tabstrip
                

REFERENCES

Visual Basic Online Help file.

Keywords: kbprb KB171348