JMK
JMK

Reputation: 28059

Aligning controls on a Visual Studio 2012 Windows Form?

I am certain that <= Visual Studio 2010 contained options to align controls on a Windows Form, but on 2012 the controls on the Layout toolbar seem grayed out, why is this?

Screenshot

I really don't want to have to install just 2010 to center a control on my Windows Form, is there a way around this?

Upvotes: 16

Views: 27932

Answers (2)

VineAndBranches
VineAndBranches

Reputation: 426

Beytan Kurt's explanation is correct. Also note that you can add the Center Horizontally and Center Vertically shortcuts to the toolbar manually, rather than using Format > Center in Form.

  1. Right-click the toolbar
  2. Click Customize...
  3. Select the Commands tab
  4. Select the Toolbar radio button and select Layout from the dropdown
  5. Click Add Command... and select Format from the Categories section
  6. Select the Center Horizontally and Center Vertically commands (not Center Horizontal and Center Vertical)

Upvotes: 15

Beytan Kurt
Beytan Kurt

Reputation: 2263

They seem to be just for multiple controls. I've tried it in VS 2010 also, same there.

For only one control, you can use Format => Center in Form => Horizontally/Vertically

In VS 2010, there are default menu buttons for the commands above, but not in VS 2012 by default. Maybe you've been confused with that. (for the certainty issue: it is for "groups of controls", as noted)

When you select multiple controls, these buttons will be available.

Upvotes: 27

Related Questions