Groups | Blog | Home
all groups > visual studio .net general > may 2006 >

visual studio .net general : Help me to correct this code


Norman Yuan
5/29/2006 11:54:58 AM
public TextBox CrearControl(string mes,string cod_uni_neg)
{
TextBox txt=new TextBox();
txt.Name="txt" + mes + "_" + cod_uni_neg;
//Set other TextBox properties
....
return txt
}

Of course you will add this newly created TextBox into Form's Controls
collection or other control container (which will be added to Form's
Controls connection eventually).


[quoted text, click to view]

Hebert
5/29/2006 12:57:32 PM
The idea is to create textbox controls with diferents names

This part of the code is wrong

TextBox "txt" + mes + "_" + cod_uni_neg = new TextBox();

Help me to correct it please...

public TextBox CrearControl(string mes,string cod_uni_neg)

{


TextBox "txt" + mes + "_" + cod_uni_neg = new TextBox();

textBox1.Wrap = true;

textBox1.ReadOnly = false;

textBox1.Enabled = true;

textBox1.Visible = true;

textBox1.Text = "YEAH";

textBox1.Width=29;

textBox1.Height =12;

textBox1.BackColor = Color.Red;

return "txt" + mes + "_" + cod_uni_neg ;

}

Thanks a lot

AddThis Social Bookmark Button