Bonjour,
j'ai deux methodes qui sont presque identique :
Je voudrais ajouter un argument en lui passant l'argument un checkbox ou Textbox... Pour que j'ai plus qu'une seul methode .
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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 public void draw_radiobutton( string name, string text, int posx, int posy) { RadioButton myButton = new RadioButton(); myButton.Name = "radiobutton_" + name + p as string; myButton.Text = text; myButton.AutoSize = true; myButton.Location = new Point(posx, posy); myButton.Size = new System.Drawing.Size(20, 20); ActiveForm.Controls.Add(myButton); val += myButton.Size.Width; val2 = myButton.Size.Width; p++; } public void draw_textbox(string name, int posx, int posy) { TextBox myButton = new TextBox(); myButton.Name = "textbox_" + name + v as string; myButton.Location = new Point(posx, posy); myButton.Size = new System.Drawing.Size(40, 20); ActiveForm.Controls.Add(myButton); val += myButton.Size.Width; val2 = myButton.Size.Width; v++; }
Comment puis je faire ?
Partager