|
-
June 12th, 2011, 01:18 PM
#1
Create Lines on Form
I'm wanting to draw a grid on a form using the line control, however it will take me ages to do it by hand! I was wondering how to create and draw lines on a form?
I tried using:
Code:
dim border as line
border.X1 = 8
border.Y1 = 8
... etc
But I get an error about the object variable not being set? I've never used code to create objects on a form before, so I'm not really sure what I'm doing!
Cheers,
-Sam
-
June 12th, 2011, 05:46 PM
#2
Re: Create Lines on Form
if you want to draw lines on the form use the Line Method
Line(x1,y1)-(x2,y2)
you can also specify a color as well as make it draw a box or a filled box see Line Method in your online help more detail and example.
Always use [code][/code] tags when posting code.
-
June 12th, 2011, 06:01 PM
#3
Re: Create Lines on Form
DataMiser is right about the Line method of the form.
Remember if you are going to use this method you should set the AutoRedraw property of the form to true, otherwise any lines drawn are cleared when the form redraws.
-
June 13th, 2011, 09:03 AM
#4
Re: Create Lines on Form
The way my program works I need to use a line object, and give each line an index value, thank you for the suggestion though
-
June 13th, 2011, 09:57 AM
#5
Re: Create Lines on Form
I've just figured it out now
-
June 13th, 2011, 10:29 AM
#6
Re: Create Lines on Form
Go to the top post, pull down THREAD TOOLS, and MARK it as RESOLVED!!!
Also, post your solution, for the next person that is looking for the answer. Pay it forward!
-
June 13th, 2011, 12:01 PM
#7
Re: Create Lines on Form
 Originally Posted by SamstaUK
The way my program works I need to use a line object, and give each line an index value, thank you for the suggestion though 
Line object will work just fine. I started to suggest that as well but the line method gives more options and uses fewer resources so in most cases is a better choice.
Always use [code][/code] tags when posting code.
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
|