draw complete border around form 
Author Message
 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.

Josh



Fri, 06 Dec 2002 03:00:00 GMT  
 draw complete border around form
Use the Ellipse function.

Declare Function Ellipse Lib "gdi32" Alias "Ellipse" (ByVal hdc As Long,
ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As
Long

--
Sheppe Pharis, MCP * 3
ActiveX/API/ASP/HTML/VBA/VBS/VB5/VB6 Developer

Draper Systems Inc (http://www.drapersystems.com)


Quote:
> 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.

> Josh



Fri, 06 Dec 2002 03:00:00 GMT  
 draw complete border around form
Thanks I'll give it a try!

Josh



Quote:
> Use the Ellipse function.

> Declare Function Ellipse Lib "gdi32" Alias "Ellipse" (ByVal hdc As Long,
> ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As
> Long

> --
> Sheppe Pharis, MCP * 3
> ActiveX/API/ASP/HTML/VBA/VBS/VB5/VB6 Developer

> Draper Systems Inc (http://www.drapersystems.com)



> > 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.

> > Josh



Fri, 06 Dec 2002 03:00:00 GMT  
 draw complete border around form

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

<Code snipped>

Quote:
> 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.

The standard VB circle routine will handle eliptic drawing.
Also make sure you clean up after yourself, at the moment your leaving your
window reagon in memory which you shouldn't do.  The tutorial over at vb
world explains how to delete it:
http://www.vb-world.net/controls/shapedforms/
Hope this helps,

    Mike



Fri, 06 Dec 2002 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. how do you draw raised borders around icon?

2. How to draw 3D borders around irregular shapes ?

3. Drawing a Border around a custom shaped window

4. How to draw 3D borders around irregular shapes ?

5. Drawing a border for a round form...

6. Drawing a border for a round form...

7. How can I draw the windows form border ?

8. Microsoft Graph Chart has white band around border

9. Print a border around a picture

10. How to put a border around text characters?

11. How to create raised border around ActiveX control

12. How to create raised border around ActiveX control

 

 
Powered by phpBB® Forum Software