Microsoft KB Archive/249633: Difference between revisions

From BetaArchive Wiki
(importing KB archive)
 
m (Text replacement - """ to """)
 
(One intermediate revision by the same user not shown)
Line 67: Line 67:
<li><p>Copy the following code into a program (.prg) file and then run the program. This code uses the customer.dbf sample table that comes with Visual FoxPro. Make sure that a path is set to the table:</p>
<li><p>Copy the following code into a program (.prg) file and then run the program. This code uses the customer.dbf sample table that comes with Visual FoxPro. Make sure that a path is set to the table:</p>
<pre class="codesample">  PUBLIC oform
<pre class="codesample">  PUBLIC oform
         oform = CREATEOBJECT(&quot;frmFilterTest&quot;)
         oform = CREATEOBJECT("frmFilterTest")
         oform.Show
         oform.Show
      
      
Line 76: Line 76:
               Width = 354
               Width = 354
               DoCreate = .T.
               DoCreate = .T.
               Caption = &quot;frmFilterTest&quot;
               Caption = "frmFilterTest"
               Name = &quot;frmFilterTest&quot;
               Name = "frmFilterTest"


               ADD OBJECT cboFilter AS combobox WITH ;
               ADD OBJECT cboFilter AS combobox WITH ;
                         RowSourceType = 6, ;
                         RowSourceType = 6, ;
                         RowSource = &quot;customer.cust_id&quot;, ;
                         RowSource = "customer.cust_id", ;
                         Height = 24, ;
                         Height = 24, ;
                         Left = 24, ;
                         Left = 24, ;
                         Top = 36, ;
                         Top = 36, ;
                         Width = 100, ;
                         Width = 100, ;
                         Name = &quot;cboFilter&quot;
                         Name = "cboFilter"


               ADD OBJECT lstCustomer AS listbox WITH ;
               ADD OBJECT lstCustomer AS listbox WITH ;
                         RowSourceType = 6, ;
                         RowSourceType = 6, ;
                         RowSource = &quot;customer.cust_id&quot;, ;
                         RowSource = "customer.cust_id", ;
                         Height = 170, ;
                         Height = 170, ;
                         Left = 180, ;
                         Left = 180, ;
                         Top = 24, ;
                         Top = 24, ;
                         Width = 100, ;
                         Width = 100, ;
                         Name = &quot;lstCustomer&quot;
                         Name = "lstCustomer"


               ADD OBJECT cmdFilter AS commandbutton WITH ;
               ADD OBJECT cmdFilter AS commandbutton WITH ;
Line 102: Line 102:
                         Height = 27, ;
                         Height = 27, ;
                         Width = 84, ;
                         Width = 84, ;
                         Caption = &quot;Filter On&quot;, ;
                         Caption = "Filter On", ;
                         Name = &quot;cmdFilter&quot;
                         Name = "cmdFilter"


               PROCEDURE Load
               PROCEDURE Load
                         SET DELETED OFF
                         SET DELETED OFF
                         SET FILTER to maxordamt &gt; 1000
                         SET FILTER to maxordamt > 1000


               PROCEDURE cmdFilter.Click
               PROCEDURE cmdFilter.Click
Line 114: Line 114:
                                 This.caption='Filter Off'
                                 This.caption='Filter Off'
                         ELSE
                         ELSE
                                 SET FILTER TO maxordamt &gt; 1000
                                 SET FILTER TO maxordamt > 1000
                                 This.caption='Filter On'
                                 This.caption='Filter On'
                         ENDIF
                         ENDIF

Latest revision as of 13:51, 21 July 2020

Knowledge Base


Article ID: 249633

Article Last Modified on 1/5/2000



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 Q249633

SYMPTOMS

When using the scroll button of a combo or list box to scroll through data that has a SET FILTER TO expression, the data in the combo or list box will not be refreshed to show the new data until the mouse button is released. If there is no SET FILTER used on the data the data moves as the scroll button moves and immediately displays the new data.

NOTE: Setting DELETED ON in Visual FoxPro 6.0 causes the same behavior to occur.

STATUS

This behavior is by design. When any type of filter is used there is no real time scrolling of data in a combo or list box.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Copy the following code into a program (.prg) file and then run the program. This code uses the customer.dbf sample table that comes with Visual FoxPro. Make sure that a path is set to the table:

       PUBLIC oform
            oform = CREATEOBJECT("frmFilterTest")
            oform.Show
        
            DEFINE CLASS frmFilterTest AS form
                  Top = 0
                  Left = 0
                  Height = 255
                  Width = 354
                  DoCreate = .T.
                  Caption = "frmFilterTest"
                  Name = "frmFilterTest"
    
                  ADD OBJECT cboFilter AS combobox WITH ;
                            RowSourceType = 6, ;
                            RowSource = "customer.cust_id", ;
                            Height = 24, ;
                            Left = 24, ;
                            Top = 36, ;
                            Width = 100, ;
                            Name = "cboFilter"
    
                  ADD OBJECT lstCustomer AS listbox WITH ;
                            RowSourceType = 6, ;
                            RowSource = "customer.cust_id", ;
                            Height = 170, ;
                            Left = 180, ;
                            Top = 24, ;
                            Width = 100, ;
                            Name = "lstCustomer"
    
                  ADD OBJECT cmdFilter AS commandbutton WITH ;
                            Top = 156, ;
                            Left = 24, ;
                            Height = 27, ;
                            Width = 84, ;
                            Caption = "Filter On", ;
                            Name = "cmdFilter"
    
                  PROCEDURE Load
                            SET DELETED OFF
                            SET FILTER to maxordamt > 1000
    
                  PROCEDURE cmdFilter.Click
                            IF This.caption='Filter On'
                                    SET FILTER TO
                                    This.caption='Filter Off'
                            ELSE
                                    SET FILTER TO maxordamt > 1000
                                    This.caption='Filter On'
                            ENDIF
                        
  2. Move the scroll button of the list or combo box and note that the data does not refresh until the mouse button is released.
  3. Select the Set Filter command button to turn the filter off and note that the data moves interactively when the scroll button is moved.
  4. Changing the SET DELETED OFF command to ON in the Load event of the code causes the same behavior to occur in both the combo and list boxes when you use Visual FoxPro 6.0.



Additional query words: KBDSE

Keywords: kbcodesnippet kbcontainer kbprb kbctrl KB249633