Wrox Programmer Forums
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 14th, 2005, 12:59 PM
Authorized User
 
Join Date: Jan 2005
Posts: 51
Thanks: 0
Thanked 0 Times in 0 Posts
Default Draw Line from coordinates

I have a string with a bunch of x and y coordinates. I was wondering is there anything in Access like there is a picture box in Visual Basic for CE so that I can just write
Object.Line coordinates or Object.DrawLine coordinates
I noticed I can do this on a report, but I need to do it on a form.

Thanks any help is would be great,
Marcin

 
Old October 14th, 2005, 01:41 PM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

You can do this by drawing segments of lines and then making them invisible, and then depending on your need, you can control the segments programmatically in the Form's On Current or On Load etc events.

The catch here is that you have to control the lines using twips (1440 per inch).

Here is some code I used to make a Vertical line visible, 3 inches from the left, two inches from the top, and one inch long:

'-----
Private Sub Form_Current()
    Me.Line30.Left = 4320
    Me.Line30.Top = 2880
    Me.Line30.Height = 1440
    Me.Line30.Visible = True
End Sub
'-----

It's not elegant, but it will work. If you make your form templates have a library of invisible vertical, horizontal and which ever angle on them, then you can grab the ones you want and move them around with code.

HTH


mmcdonal





Similar Threads
Thread Thread Starter Forum Replies Last Post
draw line at form tyh Word VBA 0 December 7th, 2007 03:14 AM
How to draw indicator line in owc line chart AlexOo General .NET 0 July 9th, 2007 10:32 PM
Draw an "elastic" line zerna Visual C++ 0 March 5th, 2007 11:15 AM
draw line hussar91404 C# 1 August 11th, 2006 03:23 AM
Draw Line talktorajeev C# 1 May 18th, 2006 08:35 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.