BUG: Validate Event Is Not Fired When Placing a FlexGrid Control on a Tab
ID: Q232268
|
The information in this article applies to:
-
Microsoft Visual Basic Learning, Professional, and Enterprise Editions for Windows, version 6.0
SYMPTOMS
When placing controls on a tab control, the Validate event is fired every time you shift the focus from one control to another, or when changing the visible tab.
If one of the controls placed on the Tab control is a FlexGrid control then the validate events are not fired correctly when moving from one tab to another using the mouse. Although they work fine if shortcuts are used on the tab's captions and the keyboard is used to move between tabs.
RESOLUTION
Use other events such as lost focus to simulate validation.
STATUSMicrosoft has confirmed this to be a bug in the Microsoft products listed
at the beginning of this article.
MORE INFORMATIONSteps to Reproduce Behavior
- Start a new standard .exe project.
- Select the Microsoft Flex Grid Control 6.0 and the Microsoft Tabbed Dialog Control 6.0 from the Components List under the Project menu.
- Place the Microsoft Tabbed Dialog Control on your form.
- Place two text boxes on a tab.
- On the same tab place the Microsoft Flex Grid Control.
- Set the CausesValidation property to True on all controls, including the tab control.
- Add a text box to the form. Call it txtLog, set Text="" and set multiline to True.
- On the Validate event from each control (including the Tab control), write a line to the txtLog control so that you can see when such events are firing as shown below:
Option Explicit
Private Sub MSFlexGrid1_Validate(Cancel As Boolean)
txtlog = txtlog & "MSFlexGrid1 Validate" & vbCrLf
End Sub
Private Sub SSTab1_Validate(Cancel As Boolean)
txtlog = txtlog & "SSTab1 Validate" & vbCrLf
End Sub
Private Sub Text1_Validate(Cancel As Boolean)
txtlog = txtlog & "Text1 Validate" & vbCrLf
End Sub
Private Sub Text2_Validate(Cancel As Boolean)
txtlog = txtlog & "Text2 Validate" & vbCrLf
End Sub
- Change the caption for each tab to:
&A, &B, &C
So that you can change the visible tab with the keyboard.
- Save and then run the project.
- Click on Text1, Text2 and the grid – validate events are being fired as expected. Click tab B. You will notice that no validate event was fired.
- Return to Tab A and click Text1. Now turn to Tab B using the keyboard (Alt + B). The validate event was fired.
- Create another project similar to this one, without a FlexGrid, and everything will work as expected.
Additional query words:
Keywords :
Version : WINDOWS:6.0
Platform : WINDOWS
Issue type : kbbug
|