[tt]
For i = 1 to MyForm.scalewidth Step 10
[tab]For j = 1 to MyForm.scaleheight Step 10
[tab][tab]MyForm.CurrentX = i
[tab][tab]MyForm.CurrentY = j
[tab][tab]MyForm.PSet
[tab]Next j
Next i
[/tt]
You will also need to do things like set the correct color, change the step distance, etc.
BTW: This is not the fastest way to do this. You might look at creating a bitmap with the pattern you want and setting the background of the form to it.
Most of all thanks for the reply, now i have a grided form
but how do i speed up the drawing process, coz i may have dots that are spaced 30 twips apart.
I do not know how you did the 'dotting', or what ver of Ms. Access you are using, so this may be completely irrevelant, but ...
PSet does not apply to FORMS in Ms. Access 2K, so if you are using that method and a previous ver of Ms. Accees, you need to be careful about the (enventual/inevitable) upgrade to ver 2K (or later)
MichaelRed
redmsp@erols.com
There is never time to do it right but there is always time to do it over
but how do i speed up the drawing process, coz i may have dots that are spaced 30 twips apart.
Look at creating a bitmap like I suggested. Drawing a bitmap as a background is a single BitBlt operation, versus several thousand for doing it inside nested loops. Be sure to create it large enough for people using 1600x1280 resolution.
Use the Line method and set the Forms DrawStyle property to vbDot.
Me.DrawStyle = vbDot
Me.Line (X1,Y1) - (X2,Y2)
To Draw a Solid Grid contour line, use
Me.DrawStyle = vbSolid
Me.Line (X1,Y1) - (X2,Y2),,B
Some restrictions may apply: if you set DrawWidth to a value different from 1, it will be ignored. _________________________________
In theory, there is no difference between theory and practice. In practice, there is. [attributed to Yogi Berra]
Some restrictions may apply: if you set DrawWidth to a value different from 1, DrawStyle will be ignored (a solid line will be produced). _________________________________
In theory, there is no difference between theory and practice. In practice, there is. [attributed to Yogi Berra]
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.