2011-07-03 3 views
0

ラジオボタンがロードされたときにこのイベントが発生します。これを防ぐ方法はありますか?コードは以下の通りである:falseにラジオボタンチェックチェンジイベントロード時に発生します

 // 
     // 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; 
+0

ボタンとやりとりしているすべてのポイントでサンプルコードを入力してください。 – DanNsk

+0

@ DanNsk上記を参照してください。 – soandos

答えて

2

ラジオボタンのCheckedプロパティのデフォルト値を、それをフォームに追加し、それが唯一のラジオボタンでされている場合、その値は、リース1つのラジオボタンあたりで(trueに変更する必要がありますグループをチェックする必要があります)。フォームに追加する(または変更されたイベントにサブスクライブする)前に、デフォルトで選択されるラジオボタンのCheckedプロパティをtrueに設定することで、イベントが発生しないようにすることができます。

関連する問題