UserForm Controls Alignment

KG Old Wolf

Board Regular
Joined
Sep 20, 2009
Messages
65
All,

Is there an easy way to set a standard distance between controls (i.e. labels and text boxes)?

It's easy enough to "select all" and get edges, height etc. the same and aligned but there has to be a better way of establishing a standard amount of separation between a set of controls without have to zoom in on the form and count the little pixel dots!

I've got to be missing something fundamental!

Thanks,
KG
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
There is no way to distribute controls evenly over a certain distance...

But you can use the grid to snap to... that makes it fairly easy to get equal distances between controls...
Go to Options, General tab, and make sure the 'Align Controls to Grid' option is checked.
 
Upvote 0
I'll have to rephrase my words to
There is no way to distribute controls evenly over a certain distance... in the formdesigner at design-time.

Sam is right of course, at runtime you can move around everything, but that doesn't make designing the form any easier :)
 
Upvote 0
Oh, yeah! I typically spend more effort in Designing the Form than I do on Run Time Code.

As in everything else we do, the more effort spent in preparation, the less spent on the "Real" work and the better the project turns out.

Here's a short lesson I wrote for a tutorial, (still under construction,) that shows just how much time is spent before I even open Excel.

http://forums.delphiforums.com/n/mb/message.asp?webtag=contractorxl&msg=40.1
 
Last edited:
Upvote 0
In design view select all the controls and goto Horizontal/Vertical spacing.

You should now be able to space them evenly and increase/decrease the space between them.
 
Upvote 0
Oops :eek:

You are totally right Norie, as usual :)

I should have taken a look in the menus instead of only checking the buttons on the Userform toolbar...

In my defense, I swear that those options were not there before tonight!! :biggrin:
 
Upvote 0
Hermanito

I don't know why but those options seem to have been hidden away.

I'm sure in the past I've added them to the right click menu or created a new menu on a toolbar for them.

Can't be bothered to do that sort of thing anymore.:)
 
Upvote 0
Hi All,

After placing all text boxes on the form do the following:
1. group all boxes
2. use the Align to Grid tool (and align Left or Right) - this will align all boxes vertically (Alternatively you can use the Format tab and click Align)
3. on the Format (tab) use: Vertical Spacing > Make Equal (this will equally space the text boxes down the form)
 
Upvote 1

Forum statistics

Threads
1,214,826
Messages
6,121,793
Members
449,048
Latest member
greyangel23

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top