BUG: Grid Control Paints Incorrectly When Press PGUP or PGDN (94296)
The information in this article applies to:
- Microsoft Visual Basic Standard Edition for Windows 2.0
- Microsoft Visual Basic Standard Edition for Windows 3.0
This article was previously published under Q94296 SYMPTOMS
The grid control may paint incorrectly when you press the PGUP or PGDN key.
Specifically, when you press the PGDN key to scroll down within a grid
control, the data in one column is painted in the next column.
WORKAROUND
This problem does not occur when you use the arrow keys or the mouse to
scroll within the grid.
You can work around the problem by refreshing the grid from within a timer.
The timer should be activated when the PGUP or PGDN key is pressed. Below
are the steps necessary to implement such a workaround: - Add a timer control (Timer1) to Form1.
- Add the following code to the KeyDown event of Grid1:
Sub Grid1_KeyDown (KeyCode As Integer, Shift As Integer)
'Key codes for the pageup and pagedown keys
Const VK_PGUP = &H21 'VK_PRIOR
Const VK_PGDN = &H22 'VK_NEXT
If KeyCode = VK_PGUP Or KeyCode = VK_PGDN Then
Timer1.Interval = 1
Timer1.Enabled = True
End If
End Sub
- Add the following code to the Timer1_Timer event:
Sub Timer1_Timer ()
Grid1.Refresh
Timer1.Enabled = False
End Sub
When you press the PGUP or PGDN key, the timer event refreshes the grid.
STATUS
Microsoft has confirmed this to be a problem in the products listed above.
We are researching this problem and will post more information here in the
Microsoft Knowledge Base when it becomes available.
Modification Type: | Major | Last Reviewed: | 10/30/2003 |
---|
Keywords: | kbbug KB94296 |
---|
|