Reputation: 677
This is my first C# program so please, forgive me.
I'm using winforms (WPF seemed more alien) and I'd like to center (or align somehow) the items on a form, but I don't know how.
I tried the Format
menu, but everything is greyed out and, in code view, nothing like HorizontalAlign property was in the suggestions.
What am I doing wrong?
Upvotes: 4
Views: 6361
Reputation: 3255
Set anchor of an item to left and right to keep it centered horizontally and top+bottom to center the item vertically. However if you have few items you want to center that's not doable really, unless you'll put them in a grouping control like Panel
for example.
Edit: I assumed we're talking about keeping items centered at runtime, because for adjusting a control to the center position there's a button on your toolbar, you know..
Upvotes: 3