Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Making a line as a divider in WinForms

Posted on 2010-01-07
22
Medium Priority
?
895 Views
Last Modified: 2013-12-17
Using Visual Studio Pro 2008 I can ont put a simple line in my dialog to divide controls.

Am I missing something?

newbieweb
0
Comment
Question by:newbieweb
  • 8
  • 5
  • 4
  • +3
22 Comments
 

Author Comment

by:newbieweb
ID: 26200141
Actually, I wouls llikw a way to divide up the dialog's controls so they appear to be grouped. Can someone suggest how to do this?

0
 
LVL 22

Accepted Solution

by:
p_davis earned 800 total points
ID: 26200188
you can use panels -- split controls or simply use the paint event of the form to draw lines.

or the groupbox.
0
 

Author Comment

by:newbieweb
ID: 26200216
could you please elaborate?
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 22

Expert Comment

by:p_davis
ID: 26200243
groupbox would probably be your best bet -- allows a label up top and you just drag controls to it. its in your toolbox.
0
 
LVL 22

Expert Comment

by:p_davis
ID: 26200246
draws a lined rectangle around your controls
0
 
LVL 22

Expert Comment

by:p_davis
ID: 26200254
0
 
LVL 42

Assisted Solution

by:Meir Rivkin
Meir Rivkin earned 800 total points
ID: 26200275
can u post a screenshot of your desired winform?
it really depends on how u wish to set the controls on the form and whether your form is sizeable or not.

as @p_davis suggested u can paint directly on the form but u should take under consideration the case which user resize the form.

to make it simple u can group your control in a group box which gives the form a nicer look.
check screenshot for example.
Untitled.jpg
0
 
LVL 42

Expert Comment

by:Meir Rivkin
ID: 26200295
sorry @p_davis, didn't see your post regarding groupbox...
0
 
LVL 22

Expert Comment

by:p_davis
ID: 26200308
its all good. thanks for the nod though
0
 

Author Comment

by:newbieweb
ID: 26200325
For this program I do not have resizing as a requirement. I just have very quick turn around time of the GUI.

I just want to divide controls into groups as you have done above. Is that a simple group box?
0
 
LVL 22

Expert Comment

by:p_davis
ID: 26200342
othere than the grids sedqwick does use groupbox for the grouping
0
 
LVL 42

Expert Comment

by:Meir Rivkin
ID: 26200353
yes, groubox control from the toolbox.
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 26200381
0
 

Author Comment

by:newbieweb
ID: 26200413
I have used a group box and think that's what I need. But I would like to make the line more visible.
0
 
LVL 42

Assisted Solution

by:Meir Rivkin
Meir Rivkin earned 800 total points
ID: 26200618
u can go crazy with "The Grouper" !!!!
check http://www.codeguru.com/csharp/csharp/cs_controls/custom/article.php/c11389/
it has the lot - border thickness, shadowing, gradient etc.

Untitled.jpg
0
 
LVL 22

Assisted Solution

by:p_davis
p_davis earned 800 total points
ID: 26200636
doesn't look like there is an absolutely easy way to do it. again to do it you will have to handle that controls paint event and overlay lines where they are drawn or derive your own control.

kind of silly really, i can't believe they don't have  property for that.... and i can't believe i have never notice it before.
0
 
LVL 6

Assisted Solution

by:Tribmos
Tribmos earned 400 total points
ID: 26200711
As they have said,  panels and group boxes

A panel can have a border (usually not) these can be put on the form (or on other controls that accept them) and you can "dock".

Docking can be, Top, Bottom, Left, Right, Fill, and none
top and bottom stay the same height but will grow in width with the application resize
left, right stay the same width, but grow in height with the application resize
Fill takes up whatever space it can
These all observe Z-Order  (right clicking a control and how the "bring to front" or "send to back" place them)

Groupbox has a border with a caption for the container.  These are a popular container and any radiobuttons placed in them are 'linked' in that checking one unchecks the others in this container
0
 
LVL 6

Expert Comment

by:Tribmos
ID: 26200762
There is a panel divider control.   I usually use it with a left dock and a fill. so that way if the user really wants the left panel wider they can manually drag it.

in 2005 its the "Splitter"  or you can go with a "SplitContainer" which will put two panels and the splitter on the form.
0
 

Author Closing Comment

by:newbieweb
ID: 31674008
thanks.
0
 
LVL 86

Expert Comment

by:Mike Tomlinson
ID: 26201605
p_davis said:

   "doesn't look like there is an absolutely easy way to do it. again to do it you will have to handle that controls paint event and overlay lines where they are drawn or derive your own control."

Did you miss emoreau's post back here:
http://www.experts-exchange.com/Programming/Languages/C_Sharp/Q_25027076.html#26200381

The Power Packs can be used in a C# app as well.  =)

See the "Line and Shape controls" section: http://msdn.microsoft.com/en-us/vbasic/bb735936.aspx
0
 
LVL 22

Expert Comment

by:p_davis
ID: 26201628
that's great but i was referring to the groupbox.
0
 
LVL 86

Expert Comment

by:Mike Tomlinson
ID: 26201646
Gotcha....
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question