enable/disable event handlers in VB .NET

boodito

New member
Joined
Sep 5, 2006
Messages
1
Programming Experience
Beginner
Hello, I have this piece of code in the CheckedChanged event handler of a group of 2 radio buttons in C#this code disables the event handler CheckedChange then enables it later, I'd like to know what's the equivalent of this code in VB .NET...


VB.NET:
Private void rbLanguage_CheckedChanged(object sender, system.EventArgs e)
this.rbLanguageEnglish.CheckedChanged -= new system.EventHandler(this.rbLanguage_CheckedChanged)
this.rbLanguageEnglish.CheckedChanged += new system.EventHandler(this.rbLanguage_CheckedChanged)
 
Last edited by a moderator:
Here you go.....

VB.NET:
Private Sub rbLanguage_CheckedChanged(Byval Sender as Object, Byval e as System.EventArgs)
RemoveHandler rbLanguageEnglish.CheckedChanged, AddressOf rbLanguage_CheckedChanged
AddHandler rbLanguageEnglish.CheckedChanged, AddressOf rbLanguage_CheckedChanged
 
Back
Top