Solved

How can I draw a line?

Posted on 2007-11-16
5
198 Views
Last Modified: 2013-12-17
Hello,

There's was a line control in VB 6, it's not available in C# 2.0.

How can I have one on my form?

Thanks.
0
Comment
Question by:EEssam
  • 3
5 Comments
 
LVL 55

Accepted Solution

by:
Jaime Olivares earned 400 total points
ID: 20300751
For vertical and horizontal lines, use a PictureBox.
Set BorderStyle to FixedSingle or Fixed3D
Set Width or Height to 1
0
 
LVL 30

Assisted Solution

by:Alexandre Simões
Alexandre Simões earned 100 total points
ID: 20300798
You can't...
You can have containers that draw on themselves but the "good" old VB6 Line is gone...

Something like jaime_olivares said is usually used... I use Labels, I think they're somewhat lighter.
0
 

Author Comment

by:EEssam
ID: 20300800
It seems to do the trick but how can I change the line color?
0
 
LVL 55

Expert Comment

by:Jaime Olivares
ID: 20300858
Also you can use a Panel control and change the Background property
0
 
LVL 55

Expert Comment

by:Jaime Olivares
ID: 20300883
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
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.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

744 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now