
02-07-2003, 02:58 AM
|
|
Senior Contributor
Retired Leader * Expert *
|
|
Join Date: Sep 2002
Location: Israel
Posts: 918
|
|
AutoRedraw = True?
I put this code on a form that has AutoRedraw = True and ScaleMode = vbPixels:
Code:
Option Explicit
Private Declare Function SetPixel Lib "gdi32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal crColor As Long) As Long
Private Sub Command1_Click()
Dim i As Long, h As Long
h = Me.ScaleHeight / 2
For i = 0 To Me.ScaleWidth
SetPixel Me.hdc, i, h, vbBlue
Next i
Me.Refresh
End Sub
and the line is permanent.
You could also put the drawing in the Paint event, set AutoRedraw to False and omit the Me.Refresh at the end.
|
__________________
Have you tried looking right in front of you (or at least in MSDN)?
|