Jump to content
Xtreme .Net Talk

Recommended Posts

Posted (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 by divil
My website
  • *Gurus*
Posted
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.

MVP, Visual Developer - .NET

 

Now you see why evil will always triumph - because good is dumb.

 

My free .NET Windows Forms Controls and Articles

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...