How to add lines to Forms and Panels using VS Forms Designer?

G

Guest

I have created several Windows Forms in an application written in C#. Some forms contain panels. There are times when it would improve the appearance of the forms if I could add separator lines (vertical or horizontal) between sets of controls. I do not want to add additional layers of controls like adding GroupBox's or Panel's when they are not called for

Is there a way in the Forms Designer to add lines

Thanks
Dav
 
K

Kai Bohli

Hi Dave !

Except for the obvious -> drawing line with GDI, the only thing I can think of is this.
1) Put a Label on your form.
2) Set the backcolor to whatever you would like.
3) Set the borderstyle to fixedsingle
4) Remove the text
4) Reshape it until you got the desired width.

HTH

I have created several Windows Forms in an application written in C#. Some forms contain panels. There are times when it would improve the appearance of the forms if I could add separator lines (vertical or horizontal) between sets of controls. I do not want to add additional layers of controls like adding GroupBox's or Panel's when they are not called for.

Is there a way in the Forms Designer to add lines?

Thanks,
Dave

Best wishes
Kai Bohli
(e-mail address removed)
Norway
 
H

Herfried K. Wagner [MVP]

* "=?Utf-8?B?RGF2ZSBMZWFjaA==?= said:
I have created several Windows Forms in an application written in C#.
Some forms contain panels. There are times when it would improve the
appearance of the forms if I could add separator lines (vertical or
horizontal) between sets of controls. I do not want to add additional
layers of controls like adding GroupBox's or Panel's when they are not
called for.

See (complete thread):

<URL:http://www.google.de/groups?selm=#[email protected]>
 
G

Guest

Kai

Using the Label is an elegant solution; quick, available, supported and does the job

Thanks
Dav


----- Kai Bohli wrote: ----

Hi Dave

Except for the obvious -> drawing line with GDI, the only thing I can think of is this
1) Put a Label on your form.
2) Set the backcolor to whatever you would like.
3) Set the borderstyle to fixedsingl
4) Remove the tex
4) Reshape it until you got the desired width

HT

I have created several Windows Forms in an application written in C#. Some forms contain panels. There are times when it would improve the appearance of the forms if I could add separator lines (vertical or horizontal) between sets of controls. I do not want to add additional layers of controls like adding GroupBox's or Panel's when they are not called for
Dav

Best wishe
Kai Bohl
(e-mail address removed)
Norwa
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top