Results 1 to 5 of 5

Thread: Rounded controls

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2000
    Location
    Singapore
    Posts
    78
    Hi all,

    Anyone knows how I can make a round form or button instead of the regular rectangular ones?

    Thanks!!


  2. #2

    Thumbs down

    You can't with the normal CommandButton control.

  3. #3
    Hyperactive Member marnitzg's Avatar
    Join Date
    Oct 2000
    Location
    South Africa
    Posts
    372
    I found this somewhere on the net.

    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()
    Show 'The form!
    SetWindowRgn hWnd, _
      CreateEllipticRgn(0, 0, 300, 200), _
      True
    End Sub
    Enjoy

  4. #4
    Hyperactive Member marnitzg's Avatar
    Join Date
    Oct 2000
    Location
    South Africa
    Posts
    372
    OK. Now anyone know how to make an irrelgular shaped form. For example the digitool skin of winamp?

  5. #5
    Frenzied Member Vlatko's Avatar
    Join Date
    Aug 2000
    Location
    Skopje, Macedonia
    Posts
    1,409
    Making complex regions can be complex. You may have to use the sin ,cos and other operators. The easiest way is to combine regions using the CombineRgn API.
    Code:
    Public Declare Function CombineRgn Lib "gdi32" Alias "CombineRgn" (ByVal hDestRgn As Long, ByVal hSrcRgn1 As Long, ByVal hSrcRgn2 As Long, ByVal nCombineMode As Long) As Long
    I am become death, the destroyer of worlds.
    mail:vlatkovr@hotmail.com

    • Visual Basic 6.0 & .NET
    • Visual C++ 6.0 & .NET
    • ASP
    • LISP
    • PROLOG
    • C
    • Pascal

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width