|
-
Jul 18th, 2023, 04:05 PM
#11
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
 Originally Posted by Nouyana
The Reason parameter in the ComboBeforeDropDown event is always FlexComboDropDownReasonInitialize. No matter if it was dropped down by mouse or keyboard or by code like the below one. By the way, what does the FlexComboDropDownReasonInitialize mean?
Code:
Private Sub Command1_Click()
With VBFlexGrid1
.Cell(FlexCellComboCue, .FixedRows, 1, .Rows - 1) = FlexComboCueDropDown
.ColComboMode(1) = FlexComboModeDropDown
.ColComboItems(1) = "Bob|Jack|Ivan"
.Cell(FlexCellText, .FixedRows, 1, .Rows - 1) = "Bob"
.StartEdit 1, 1
.ComboButtonValue = FlexComboButtonValuePressed
.EditText = "Jack"
.CommitEdit
End With
End Sub
Private Sub VBFlexGrid1_ComboBeforeDropDown( _
ByVal Reason As FlexComboDropDownReasonConstants, _
Cancel As Boolean)
Debug.Print "Reason: "; Reason ' THIS ALWAYS RETURNS 1.
End Sub
FlexComboDropDownReasonInitialize is when the drop-down list (or calendar) automatically shows upon the .StartEdit.
This is the only way to suppress behavior by checking Reason for FlexComboDropDownReasonInitialize in the ComboBeforeDropDown event. This way it is possible to prevent auto drop-down.
The following scenarios for FlexComboDropDownReasonInitialize:
1. Edit reason is one of the ComboCue* reasons.
2. The combo mode is "DropDown" (not "Editable")
3. The combo mode is "Calendar" AND the edit control has ES_READONLY.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|