hog Posted April 3, 2003 Posted April 3, 2003 (edited) I'm using this code to set an objects property to show if a po is internal or external, but am getting stuffed as it gets called twice, once for each control. This means even if I select external the form show internal. It's driving me nuts and I am possibly not seeing the wood for the tress but.........help?? Private Sub Radiobutton_CheckChanged(ByVal sender As Object, ByVal e As System.EventArgs) _ Handles radInternal.CheckedChanged, radExternal.CheckedChanged If Not blnRefreshingForm And Not blnFormLoading Then Dim ctlSender As Control = CType(sender, RadioButton) Select Case ctlSender.Name Case "radInternal" m_objContract.InternalPO = Me.radInternal.Checked Case "radExternal" m_objContract.InternalPO = Me.radExternal.Checked End Select Me.cmdSave.Enabled = True Me.cmdAdd.Enabled = True Me.chkDataChanged.Checked = True End If End Sub Edited April 3, 2003 by divil Quote My website
*Gurus* divil Posted April 3, 2003 *Gurus* Posted April 3, 2003 If there's only two options, it's only necessary to wire up the event to one of them. After all, the event gets fired when the user has checked it, and when they have checked something else if it was previously checked. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
hog Posted April 3, 2003 Author Posted April 3, 2003 Well blow me!! I cannot believe it was that simple......THANKS :-) Quote My website
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.