drawing border within form

drawing border within form

Post by John Langle » Fri, 19 Feb 1999 04:00:00

I am attempting to draw a border around the innermost inside edge of a
form that will not be obscured by the form's children (mainly TPanels).
Setting Form.BorderWidth := x & Form.Color := clx works except for
flicker. Now I can hack away at the flicker, but I thought it would be
better & more appropriate to draw a line rather than paint a whole
canvas. Unfortunately, I can't draw a line that isn't partially or
wholly covered by one of the Forms children. Can someone tell me how?


John Langley


1. draw complete border around form

I have a form that I have modified the shape using the following code:

Private Declare Function CreateEllipticRgn Lib "gdi32" _
    (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, _
    ByVal Y2 As Long) As Long

Private Declare Function SetWindowRgn Lib "user32" _
    (ByVal hwnd As Long, ByVal hrgn As Long, _
    ByVal bredraw As Boolean) As Long

Private Sub Form_Load()

'Set window shape to a circle
SetWindowRgn Me.hwnd, CreateEllipticRgn(0, 0, 500, 300), True

End Sub

My question is I would like to draw a border around the complete reshaped
form. Anyone have any ideas on how to go about this. Thanks in advance.


2. 3D clipping

3. How can I draw the windows form border ?

4. Installing Patches

5. How do I get the size of form borders and title bar on a form

6. Free seminar - Speed Razor & DPS Perception - Los Angeles

7. DragDrop problems from within one ActiveX control to the outside form

8. BONES, how the ...... do i make nice animations with bones?

9. Color Gradients within forms

10. Embed one form within another

11. Help-Receive Win Message from within a VB form

12. Displaying an ActiveX DLL form within calling .EXE window

13. Dialog forms within 1 window