add control at runtime
-
I am able to add controls at runtime but i am not able to specify the height and width of the control.How can i do it ?
Mohinder Singh
You should be able to. Please provide an example of what you've done.
Mark, http://aspnetlibrary.com
-
I am able to add controls at runtime but i am not able to specify the height and width of the control.How can i do it ?
Mohinder Singh
Its very simple you have height and width property to control e.g for TextBox TextBox txt = new TextBox(); txt.ID = "ControlID" txt.Width = 50; txt.Height = 23; panelSample.Controls.Add(txt); if you don't have then use style sheet i.e css file and give class name to cssClass property of the control
Thanks and Regards Sandeep If you want something you never had, do something you have never done!
-
Its very simple you have height and width property to control e.g for TextBox TextBox txt = new TextBox(); txt.ID = "ControlID" txt.Width = 50; txt.Height = 23; panelSample.Controls.Add(txt); if you don't have then use style sheet i.e css file and give class name to cssClass property of the control
Thanks and Regards Sandeep If you want something you never had, do something you have never done!
sandeep akhare wrote:
txt.Width = 50; txt.Height = 23;
try: txt.Height = new Unit(UnitType.pixel, 50.00);
"Now I guess I'll sit back and watch people misinterpret what I just said......" Christian Graus At The Soapbox
-
sandeep akhare wrote:
txt.Width = 50; txt.Height = 23;
try: txt.Height = new Unit(UnitType.pixel, 50.00);
"Now I guess I'll sit back and watch people misinterpret what I just said......" Christian Graus At The Soapbox
OOPS thanks for corrections
Thanks and Regards Sandeep If you want something you never had, do something you have never done!
-
sandeep akhare wrote:
txt.Width = 50; txt.Height = 23;
try: txt.Height = new Unit(UnitType.pixel, 50.00);
"Now I guess I'll sit back and watch people misinterpret what I just said......" Christian Graus At The Soapbox
-
sandeep akhare wrote:
txt.Width = 50; txt.Height = 23;
try: txt.Height = new Unit(UnitType.pixel, 50.00);
"Now I guess I'll sit back and watch people misinterpret what I just said......" Christian Graus At The Soapbox
hi dear i am doing this but the textbox is not being shown in the form. Dim txt as textbox Txt = New TextBox Txt.ID = "SubmitBtn" Txt.TextMode = TextBoxMode.MultiLine Txt.Height = New Unit(UnitType.Pixel, 24.0) Txt.Width = New Unit(UnitType.Pixel, 250) PlaceHolder1.Controls.Add(Txt) I am using place holder. when i dont give any height and width i get the textbox but it is small. and i want a bigger textbox.
Mohinder Singh
-
OOPS thanks for corrections
Thanks and Regards Sandeep If you want something you never had, do something you have never done!