Validation within a Combobox


Author
Message
Edhy Rijo
E
StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
In a childform dialog, I have a textbox txtItemPrice that needs to be updated from a combobox items lookup, I have the following code in the combobox.SelectedIndexChanged:

Private Sub cboItemName_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cboItemName.SelectedIndexChanged

     '-- Look the item price and if found and there is a current price, ask

     ' the user if he/she wants to overwrite the Item Price.

     If Me.BizItems_Lookup.Count > 0 Then

          If Me.BizItems_Lookup.SeekToPrimaryKey(Me.bizSC_AppliancesItems1.FK_Items) Then

               If Me.bizSC_AppliancesItems1.ItemPrice <= 0 Then

                    Me.bizSC_AppliancesItems1.ItemPrice = Me.BizItems_Lookup.ItemPrice

               Else

                    If Me.ShowMessageByKey("ApplianceItems_OverwriteItemPrice", Me.bizSC_AppliancesItems1.ItemPrice, Me.BizItems_Lookup.ItemPrice) = MicroFour.StrataFrame.Messaging.MessageFunctionType.Yes Then

                         Me.bizSC_AppliancesItems1.ItemPrice = Me.BizItems_Lookup.ItemPrice

                    End If

               End If

          End If

          Me.bizSC_AppliancesItems1.Refresh("ItemPrice")

     End If

End Sub

The problem is that when the ChildFormDialog is being loaded, the cboItemName_SelectedIndexChanged method is being fired several times, even when the form has not even shown.  In VFP I would simply put the code in the combobox.Valid(), how to get the same effect as the VFP combobox.Valid() or what event should be used in the combo in this scenario ?

Edhy Rijo

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Edhy Rijo - 16 Years Ago
Geoff Hirst - 16 Years Ago
Trent L. Taylor - 16 Years Ago
Edhy Rijo - 16 Years Ago
Trent L. Taylor - 16 Years Ago
                         Great! Thanks!
Edhy Rijo - 16 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search