c# - radiobutton checkedchange event fired when it loads -
why event firing when radiobutton gets loaded? there way prevent this? code follows:
// // radiobutton1 // this.radiobutton1.autosize = true; this.radiobutton1.location = new system.drawing.point(6, 19); this.radiobutton1.name = "radiobutton1"; this.radiobutton1.size = new system.drawing.size(75, 17); this.radiobutton1.tabindex = 0; this.radiobutton1.tabstop = true; this.radiobutton1.text = "you guess"; this.radiobutton1.usevisualstylebackcolor = true; this.radiobutton1.checkedchanged += new system.eventhandler(this.radiobutton1_checkedchanged); this.groupbox1.controls.add(this.radiobutton1); public system.windows.forms.radiobutton radiobutton1;
the radio button's checked property defaults false, when added form , radio button, value must change true (at lease 1 radio button per group must checked). can prevent event firing setting checked property radio button want selected default true before add form (or subscribe changed event).
Comments
Post a Comment