|
-
Jan 30th, 2001, 11:03 AM
#3
Thread Starter
Member
graphics
Originally posted by Megatron
You need a little bit of API. Use the DrawPoint function as shown below.
Code:
Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function MoveToEx Lib "gdi32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, lpPoint As POINTAPI) As Long
Private Declare Function LineTo Lib "gdi32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long) As Long
Private Type POINTAPI
x As Long
y As Long
End Type
Private Sub DrawPoint(fromX, fromY, toX, toY)
Dim hDC_Grid As Long
Dim PT As POINTAPI
hDC_Grid = GetDC(MSFlexGrid1.hwnd)
MoveToEx hDC_Grid, fromX, fromY, PT
LineTo hDC_Grid, toX, toY
End Sub
Private Sub Command1_Click()
'Draw a line from (5,5) to (100,100)
DrawPoint 5, 5, 100, 100
End Sub
Thank you!!
Another Question!
Data is entered into the Flexgrid Directly, at runtime. i have assigned the x-coordinates to the variable cat and the y-coodinates to the variable dog- how can i draw a line between these two variables???
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
|