|
-
Nov 13th, 2002, 05:03 PM
#1
Thread Starter
Addicted Member
Where'd the line control go?
I don't see any line controls...
How would I draw a line without using a code?
-
Nov 13th, 2002, 05:18 PM
#2
Frenzied Member
You can use the label control. Set the width to 2 and set the borderstyle to single, then make the lenght whatever you want.
Dont gain the world and lose your soul
-
Nov 14th, 2002, 11:01 AM
#3
Thread Starter
Addicted Member
That's a funny way to do it
So there isn't a way to use a color for that "line" or change the width of the line?
-
Nov 14th, 2002, 01:20 PM
#4
Frenzied Member
Well there are other ways. You can use GDI+ to draw the line on the form, but you'll have to use code. If you do it that way, you can change width and color. The label control does'nt give you much options, but it works
Dont gain the world and lose your soul
-
Nov 15th, 2002, 12:04 PM
#5
Frenzied Member
Of course, you could always use an image. Once again it's not exactly the same, but it's possible.
And then there is always my sneeky way:
VB Code:
With Label5
.AutoSize = True
.Text = "___________"
.ForeColor = System.Drawing.Color.Red
End With
~Peter

-
Nov 15th, 2002, 05:07 PM
#6
Thread Starter
Addicted Member
So if I want to draw a line diagonally, I'll have to use the GDI+ thing? (Of course, I could always use bunch of /'s. )
-
Nov 16th, 2002, 04:54 PM
#7
PowerPoster
Here you go, try something like this to get your line:
VB Code:
Private Sub Form1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint
Dim gr As Graphics
Dim pen As Pen
pen = New Pen(System.Drawing.Color.Black)
pen.Width = 5
gr = e.Graphics
gr.DrawLine(pen, 10, 10, 200, 200)
End Sub
-
Dec 6th, 2002, 06:13 AM
#8
Addicted Member
In my programs it turned into a 1 pixel high Panel.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|