473,395 Members | 1,488 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Line on a VB.NET form

This is driving my crazy! I can not find the option to
draw a line in VB.NET. In VB6 there was a line control
drag and drop. Can someone help please?

I am assumming it is hidden somewhere!

Thanks
Nov 19 '05 #1
3 28409
You can use the Graphics.DrawLine method. For example:
Dim myPen As New System.Drawing.Pen(System.Drawing.Color.Red)
Dim formGraphics as System.Drawing.Graphics
formGraphics = Me.CreateGraphics()
formGraphics.DrawLine(myPen, 0, 0, 200, 200)
myPen.Dispose()
formGraphics.Dispose()

For more you can take a look in help under "graphics, examples [Visual
Basic]" or "graphics, what's changed"

Elena Arzac

--------------------
Content-Class: urn:content-classes:message
From: "brian" <br****@lbrspec.com>
Sender: "brian" <br****@lbrspec.com>
Subject: Line on a VB.NET form
Date: Fri, 22 Aug 2003 13:15:05 -0700
Lines: 7
Message-ID: <02****************************@phx.gbl>
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Thread-Index: AcNo6hNheCpWLVIPTqWp6RHjjlDi1g==
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
Newsgroups: microsoft.public.dotnet.languages.vb
Path: cpmsftngxa06.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.vb:129786
NNTP-Posting-Host: TK2MSFTNGXA13 10.40.1.165
X-Tomcat-NG: microsoft.public.dotnet.languages.vb

This is driving my crazy! I can not find the option to
draw a line in VB.NET. In VB6 there was a line control
drag and drop. Can someone help please?

I am assumming it is hidden somewhere!

Thanks


Nov 19 '05 #2
> This is driving my crazy! I can not find the option to
draw a line in VB.NET. In VB6 there was a line control
drag and drop. Can someone help please?


This is another question that is asked, over and over and over and over. If
you search http://groups.google.com/ you will find tons of results, or you
can search MSDN, or the .NET Help files. I belive I saw Wagner post a link
to a downloadable line control before, but here is the official MS
statement:

http://msdn.microsoft.com/library/en...albasicnet.asp

Basically, they say use a label control with no text and no border & set the
bg color to black, and the width or height = 1

HTH

~
Jeremy

Nov 19 '05 #3
Hello,

"brian" <br****@lbrspec.com> schrieb:
This is driving my crazy! I can not find the option to
draw a line in VB.NET. In VB6 there was a line control
drag and drop. Can someone help please?


There are no line controls available any more.

http://download.microsoft.com/downlo...neControls.msi

HTH,
Herfried K. Wagner
--
MVP · VB Classic, VB .NET
http://www.mvps.org/dotnet
Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: G Kannan | last post by:
Hey all! I have written a perl script to retrieve information from a HTML Form and insert the data into an Oracle database table. I am gettting the the following error message: "Use of...
2
by: Stuart Masters | last post by:
Could somebody please tell me if it is possible, and if so how, to place a command button on a form so that when it is clicked a black line will be placed through all the clients information (name,...
10
by: Deano | last post by:
I think that just about sums it up. Is there a fix/workaround for this?It's quite annoying behaviour and not user-friendly.thanksMartin
2
by: Mantorok Redgormor | last post by:
what is the purpose of the #line directive? how is it suppose to be used? I didn't see it mentioned in the faq and I can't make any sense of it from the standard. -- nethlek
1
by: VMI | last post by:
In my Windows app, if I'm in a multi-line textbox and I'm writing a postal address (ie. write ist line and press <Enter>, write 2nd line and press <Enter>, etc...) how can I make sure that the...
7
by: Jacky Luk | last post by:
Does anyone know of a downloadable Line ActiveX control which allows me to plot straight lines on a VC++.NET form? Thanks Jack
2
by: Martijn Mulder | last post by:
I want to know if the mouse is over (hitting) a line. Therefore I created a Region object that holds the line and use the IsVisible() method to test if the mouse hits the line. It doesn't work! In...
13
by: Martijn Mulder | last post by:
I try to define a line with the length of 1 unit (1 pixel) that is, in fact, just a point on the screen. But when I draw it with a wide pen with the appropriate StartCap and EndCap (Round), it will...
7
by: Jwe | last post by:
Hi, I've written a program which has both a command line interface and Windows form interface, however it isn't quite working correctly. When run from command line with no arguments it should...
11
by: JWest46088 | last post by:
I'm having difficulty trying to figure out how to print a text file from a hash table one line at a time. I have the text file read into the hash table and can print the text file all at once, but I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.