Re: Event firing twice in UserControl issue
- From: "Kevin S Gallagher" <kevin.s.gallagher@xxxxxxxxxxx>
- Date: Mon, 20 Oct 2008 09:09:55 -0700
Just thought I chime in and say I never found any reason for the event to
fire twice.
"Kevin S Gallagher" <kevin.s.gallagher@xxxxxxxxxxx> wrote in message
news:OnhxdF8LJHA.2760@xxxxxxxxxxxxxxxxxxxxxxx
I have a user control (from Microsoft which originally was simply a control
with no panel) with a panel then a custom ListControl. I want to be able to
trap SelectedValueChanged event of the ListControl. The code shown below
works but fires off the event twice, any thoughts?
Imports System.ComponentModel
Public Class RadioButtonListPanel
Public Event selectedvaluechanged(ByVal sender As Object, ByVal e As
System.EventArgs)
Private Sub radiobuttonlist1_selectedvaluechanged(ByVal sender As Object,
ByVal e As System.EventArgs) _
Handles RadioButtonList1.SelectedValueChanged
RaiseEvent selectedvaluechanged(sender, e)
End Sub
...
Code in form hosting the control
Private Sub RadioPanel1_SelectedValueChanged(ByVal sender As Object, ByVal
e As System.EventArgs) _
Handles RadioPanel1.selectedvaluechanged
If RadioPanel1.RadioButtonList1.SelectedIndex > -1 Then
Console.WriteLine(" --> {0}",
RadioPanel1.RadioButtonList1.SelectedValue.ToString)
End If
End Sub
.
- References:
- Event firing twice in UserControl issue
- From: Kevin S Gallagher
- Event firing twice in UserControl issue
- Prev by Date: RE: ToolStripMenuItem highlight color?
- Next by Date: Missing/worthless DragDrop EventArgs in Designer
- Previous by thread: Event firing twice in UserControl issue
- Next by thread: Detect If Control Already Has Event Handler Attached
- Index(es):
Relevant Pages
|