I want to draw a circle on a form in visual basic editor as you can do in VB6 with the shape control. I searched for that control but it is nowhere to be found and I have no idea how to do it elseway...
Any help would be welcome!
Printable View
I want to draw a circle on a form in visual basic editor as you can do in VB6 with the shape control. I searched for that control but it is nowhere to be found and I have no idea how to do it elseway...
Any help would be welcome!
Use the Drawing toolbar and record a macro to get the base code.
You can use the API to draw this on, here's a sample taken from allapi.net using the Ellipse API call:
VB Code:
Private Type POINTAPI x As Long y As Long End Type Private Declare Function GetWindowDC Lib "user32" (ByVal hwnd As Long) As Long Private Declare Function Ellipse Lib "gdi32" (ByVal hdc As Long, _ ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, _ ByVal Y2 As Long) As Long Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long Private Sub UserForm_Click() Dim Position As POINTAPI GetCursorPos Position Ellipse GetWindowDC(0), Position.x - 5, Position.y - 5, _ Position.x + 5, Position.y + 5 End Sub