Solved

Uneven Forms

Posted on 1998-11-14
4
159 Views
Last Modified: 2010-04-30
hey, I guess u guys have seen the mp3 player Sonique... the version I have is beta .55 ... Anyway, I wuz just wondering,... how can you make an unevenly shaped form in VB5 (round... protruding, oval etc... )

thanx
0
Comment
Question by:lamer
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 2

Accepted Solution

by:
trillo earned 50 total points
ID: 1444916
Hi.
I haven't seen the Sonique mp3 player but I guess I know what you're asking for.
You have to use the SetWindowRgn function to change the shape of your Form to any other shape.
Of course, you should pass a handle to a region to this function.... so must first create the region or shape. You can do this by calling any of the Region fuctions provided by the Windows API. This way, you can combine, intersect, end make other operations to simple regions to create complex regions (or shapes).

This is a sample code for what you need. I'll use an elliptic Region.
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

Private Sub Command1_Click()
    Unload Me
End Sub

Private Sub Form_Load()
    Dim hr&, dl&
    Dim usew&, useh&
    usew& = Me.Width / Screen.TwipsPerPixelX
    useh& = Me.Height / Screen.TwipsPerPixelY
    hr& = CreateEllipticRgn(0, 0, usew, useh)
    dl& = SetWindowRgn(Me.hWnd, hr, True)
End Sub

Private Sub Picture1_Click()
    Label1.Caption = "Picture clicked"
End Sub

I hope this can help you.
0
 

Author Comment

by:lamer
ID: 1444917
thanx.. I'll try to get back to ya soon
0
 
LVL 2

Expert Comment

by:trillo
ID: 1444918
OK
0
 

Author Comment

by:lamer
ID: 1444919
excellent dude!

Well, it'll be a pain to sychronize the backround picture with the form...
0

Featured Post

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

690 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question