Click here to Skip to main content
15,881,852 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Does anyone have ideas on how to align two controls at runtime using .net with c#
Posted
Comments
Sergey Alexandrovich Kryukov 21-Nov-11 3:38am    
A vote of 1 for being so lazy. Why asking when it's much better to write? ask a question if stuck.
--SA

1 solution

I assume this is Winforms.
To get the tops aligned just use
C#
control1.Top = control2.Top;

to align the left sides
C#
control1.Left = control2.Left
;

where control1 and control2 would be replaced by your actual control names.
 
Share this answer
 
Comments
Mehdi Gholam 21-Nov-11 2:01am    
5'ed
Wayne Gaylard 21-Nov-11 2:13am    
Thanks!
Sergey Alexandrovich Kryukov 21-Nov-11 3:37am    
Simple, isn't it. A 5.
--SA
Wayne Gaylard 21-Nov-11 3:44am    
I would have thought so :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900