[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Uneven Forms

Posted on 1998-11-14
4
Medium Priority
?
164 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 200 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

What’s Wrong with Your Cloud Strategy ?

Even as many CIOs are embracing a cloud-first strategy, the reality is that moving to the cloud is a lengthy process and the end-state is likely to be a blend of multiple clouds—public and private. Learn why multicloud solutions matter in this webinar by Nimble Storage.

Question has a verified solution.

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

If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

656 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