Making a round command button 
Author Message
 Making a round command button

Quote:

>Is there a way to make a round command button by superimposing a circle =
>shape over a command button?  How would it be coded?

Go to the Web page in my sig and download ROUND.ZIP.  It demonstrates how to
create round forms and command buttons.

Lee Weiner
weiner AT fuse DOT net
http://www.*-*-*.com/



Sun, 12 Aug 2001 03:00:00 GMT  
 Making a round command button

Quote:

>This is a multi-part message in MIME format.

>------=_NextPart_000_0013_01BE5F4E.61938C20
>Content-Type: text/plain;
>    charset="iso-8859-1"
>Content-Transfer-Encoding: quoted-printable

>Is there a way to make a round command button by superimposing a circle =
>shape over a command button?  How would it be coded?

You can use two API's to create round command buttons.  Paste the
following
declarations into the General Declarations section of a form:

  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 Long) As Long

Paste the following code in the Form_Load event to make Command1
round.  It
will have a diameter equal to the width of the rectangular button in
design
mode:

    Dim lHr As Long, lDl As Long
    Dim lUsew As Long, lUseh As Long

    Command1.Height = Command1.Width
    lUsew = Command1.Width / Screen.TwipsPerPixelX
    lUseh = Command1.Height / Screen.TwipsPerPixelY
    lHr = CreateEllipticRgn(0, 0, lUsew, lUseh)
    lDl = SetWindowRgn(Command1.hWnd, lHr, True)

You can also make elliptical buttons by not setting the button height
equal to
its width.

HTH,
Ed Phillippe



Sun, 12 Aug 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Round command buttons?

2. Round Command Buttons???

3. rounded command button in VB5

4. Round Command Button Control?

5. Rounded command buttons in VB5

6. Round buttons round forms

7. How to Execute Already made Exe files from a Command Button

8. Making a command button flat

9. Making Command Buttons Change Color

10. How to Execute Already made Exe files from a Command Button

11. Making a Command Button Look Selected with Code??

12. Making the caption on command button wrap around

 

 
Powered by phpBB® Forum Software