Merci sevyc64 et Graffito.
Une semaine en retard pour vous répondre --> Mes excuses.
J'ai la solution:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
| // rB_Edit
this.rb_Edit = new RadioButton();
this.rb_Edit.AutoSize = true;
this.rb_Edit.Location = new System.Drawing.Point(61, 13);
this.rb_Edit.Name = "Edit";
this.rb_Edit.Size = new System.Drawing.Size(43, 13);
this.rb_Edit.TabIndex = 1;
this.rb_Edit.TabStop = true;
this.rb_Edit.Text = "Edit";
this.rb_Edit.UseVisualStyleBackColor = true;
// this.rb_Edit.FlatStyle = FlatStyle.System;
//
// rB_View
this.rb_View = new RadioButton();
this.rb_View.AutoSize = true;
this.rb_View.Location = new System.Drawing.Point(7, 13);
this.rb_View.Name = "View";
this.rb_View.Size = new System.Drawing.Size(48, 13);
this.rb_View.TabIndex = 0;
this.rb_View.TabStop = true;
this.rb_View.Text = "View";
this.rb_View.UseVisualStyleBackColor = true;
this.rb_View.Checked = true;
//
// gB_ViewEdit
this.gb_ViewEdit = new GroupBox();
this.gb_ViewEdit.SuspendLayout();
// this.gb_ViewEdit.FlatStyle = FlatStyle.System;
this.gb_ViewEdit.Controls.Add(this.rb_Edit);
this.gb_ViewEdit.Controls.Add(this.rb_View);
this.gb_ViewEdit.Location = new System.Drawing.Point(this.btn_Refresh.Right + 10, -10);
this.gb_ViewEdit.Name = "ViewEdit";
this.gb_ViewEdit.Size = new System.Drawing.Size(100, 40);
this.gb_ViewEdit.TabIndex = 4;
this.gb_ViewEdit.TabStop = false;
this.gb_ViewEdit.Text = ".";
//
this.Right_SplitPanel.Panel2.Controls.Add(this.gb_ViewEdit);
this.gb_ViewEdit.Click += new System.EventHandler(this.onRB_ViewEdit_CheckedChanged);
this.gb_ViewEdit.ResumeLayout(false);
this.gb_ViewEdit.PerformLayout();
// this.ResumeLayout(false); |
Voir screenshot en pièce jointe (RadioButtons1.png).
Mais
this.btn_Remove.Click += new EventHandler(onBtn_Remove_Click);
n'appelle hélas pas encore ma fonction
1 2 3 4 5 6 7 8 9 10 11 12
| void onRB_ViewEdit_CheckedChanged(object sender, EventArgs e)
{
if (this.rb_Edit.Checked)
{
this.dataGridView.EditMode = DataGridViewEditMode.EditOnEnter;
this.dataGridView.Focus();
}
else
{
this.dataGridView.EditMode = DataGridViewEditMode.EditProgrammatically;
}
} |
Pourtant j'emploie '...Click' et 'EventHandler(...'
Comment cela se faisse ?
Merci d'avance.
Partager