How to move Control Using CodeBehind

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Dear friens,

Does anybody knows how to move controls (images, textboxes, buttons, etc..) using CodeBehind?

Regards,
 
By using the word "move", do you mean "changing the location/coordinates of
control" or "moving the control to another page" or whatever?
 
I’m sorry …

I need to change the location/coordinates of
Control on the same page.
 
Since the page layout of ASP.NET page is in fact built by HTML, you have to
control
the location by putting them in table and control the width, height and
which cell does will the control be place in. and maybe you'll need to
generate the controls dynamically.

"Robson Carvalho Machado" <Robson Carvalho
(e-mail address removed)> ¦b¶l¥ó
 
use attributes to move it
dropdownlist1.attributes.add("left","10px"); top 50px for example
 
Ha... I didn't realise the use of attribute can be used this way. Thanks for
the information. :)

Alvin Bruney said:
use attributes to move it
dropdownlist1.attributes.add("left","10px"); top 50px for example

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
Lau Lei Cheong said:
Since the page layout of ASP.NET page is in fact built by HTML, you have
to
control
the location by putting them in table and control the width, height and
which cell does will the control be place in. and maybe you'll need to
generate the controls dynamically.

"Robson Carvalho Machado" <Robson Carvalho
(e-mail address removed)> ¦b¶l¥ó
 
DropDownList1.Style["Left"] = "500";
DropDownList1.Style["top"] = "500";

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
Robson Carvalho Machado said:
Dear Alvin,

I've tried your suggestion but it does not work.
Have you any other tip that can help me to solution this problem?


Alvin Bruney said:
use attributes to move it
dropdownlist1.attributes.add("left","10px"); top 50px for example

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
Lau Lei Cheong said:
Since the page layout of ASP.NET page is in fact built by HTML, you
have
to
control
the location by putting them in table and control the width, height and
which cell does will the control be place in. and maybe you'll need to
generate the controls dynamically.

"Robson Carvalho Machado" <Robson Carvalho
(e-mail address removed)> ¦b¶l¥ó
¤¤¼¶¼g...
Sorry ...

I need to change the location/coordinates of
control

:

By using the word "move", do you mean "changing the
location/coordinates
of
control" or "moving the control to another page" or whatever?

"Robson Machado" <Robson (e-mail address removed)> |b?l¢Do
?????g...
Dear friens,

Does anybody knows how to move controls (images, textboxes,
buttons,
etc..) using CodeBehind?

Regards,
 
Back
Top