Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding a Horizontal Rule in a User Form

Status
Not open for further replies.

Pudsters

Technical User
Mar 16, 2006
151
US
How do I add a Horizontal Rule to a user form like the ones when you select Tools/Options in Excel?

My Toolbox Controls doesn't offer anything for making lines.

I'm using Office 97

Thanks, Scott
 

One way is with an Image (No actual image is required, just the empty frame). Set the .Height property to 1.

 
Not bad I can't get it to make the two tone white/black look like a real horizontal rule. I tried putting two different colored ones right next to each other but I couldn't get them close enough
 

I don't really understand what you mean, but you can use the properties window to set the .Top value to whatever position you want: You can put 2 image boxes on the form and set their .Height properties to 1 and their .Top properties 1 pixel apart. (E.g. 48 and 49)

 
I think your best bet is to use a frame.

Set its height to 1 or 2, its length to whatever you need and its background colour to black. You should see a long thin black line on your userform.
 
Zathras, thanks. I forgot I could control the exact vertical position in the properties window. Looks better than just a plain line.

I still haven't heard from anyone how to add a real HR,like the ones in Excel/Tools/Options though.
 
I figured it out myself. Simply create a Frame without a caption and set the height to 2. Looks great for separating sections on a form.
 
Gerry, I guess you are right, I overlooked his comment because he suggested setting the height to 1 and seeing a thin black line, which is NOT what I wanted. So I never even tried it when I read it. You need to set the height to 2 so you see the two-tone line, which looks much better.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top