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




Reply With Quote