I need to draw a line on a form

homer2002

Registered User.
Local time
Today, 17:38
Joined
Aug 27, 2002
Messages
152
Can I just draw a line on a form???


i.e in VB i would code


Line (0,0)-(100,100),vbRed

i need the VBA version (if there is one)


does anyone know of this... surley it can't be that hard
 
homer2002,

I dont think you can draw on a form(U can use that method to draw on a report) stupid access!!


the only method i know of to draw a line incode is to open ANOTHER form in design view

DOCMD.OpenForm "someform",acdesign

then create line objects on the form.

CreateControl("someform",acLine)

The line object can then be sized and moved as required

after its all complete then open the form in normal mode

DOCMD.OpenForm "someform",acnormal


Hope this helps


:cool:ShadeZ:cool:
 
Stupid access!


All i want to do is make the background of my form a nice gradient

like this....

http://www.peterssoftware.com/bcg2.htm


i just don't have an unzip program cause i am at work


i was gonna code it like this

dim i as single
for i = 1 to me.insidewidth
line(i,0)-(i,insidehight)
next i



(and add in a bit of color control as it loops)
 
hmm i wouldn't use the line method i mentioned to do that, Access will just crash.

in my experiance any picture or clever graphics jus kill access in the end (It jus eats up access memory, which it doent release)

the best way i can think of doing it is to use api calls (not done this myself)
 
thanks Mile-O;)

Saves me having to dig one out.

:D
 
homer2002 said:
Can I just draw a line on a form???
i.e in VB i would code
Line (0,0)-(100,100),vbRed
i need the VBA version (if there is one)
does anyone know of this... surley it can't be that hard


I know this is an old post, but I came across it so I might as well post.

Both of the examples given in the thread have great examples of how to work with gradients, using the Windows API.

But to answer your original question (eventhough you revealed the real purpose behind it) yes you can create lines on forms. You can easily create lines, rectangles, circles, labels, and any other control/object. The problem exists that in order to create these objects, the form must be closed or in design mode in order to edit. However, you cannot add a line after the form is opened.
 

Users who are viewing this thread

Back
Top Bottom