Solved

Designing beautiful windows in vb?

Posted on 2002-07-11
8
385 Views
Last Modified: 2010-05-02
I want to design a beautiful windows in my
vb application. For example like windows media player,
Real player etc. How can I desing beautiful windows like
that. Curly edges, beautiful buttons with beautiful colors. I also want to know how can I animate
a running piglet or running horse when user waits
after he clicks on a command button for copying
files etc..
I need real world solution.

I can appreciate your help.

Suresh
0
Comment
Question by:sureshpodaralla
8 Comments
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 7146700
Hi, you need to manage GDI API to get your wishes.
There is a plenty of resources for that in Internet.
Take a look at www.planet-source-code.com 
www.freevbcode.com 
or simply do a search at www.google.com
0
 
LVL 22

Expert Comment

by:rspahitz
ID: 7146855
One way to create the nice buttons is to simply use an image control and treat it like a command button.

First, you'll need at least two versions of the button image: one for the button in the up position, and one in the down position, and maybe one when disabled.

After that, you'll have to intercept the mousedown and keydown events to see if the button was activated.  If so, change to the "down" image.  On mouseup and keyup, revert to the "up" image.  In the click procedure, run your activate code as though it were a button click.

Private mstrPath As String

Private Sub Form_Load()
  mstrPath = "C:\Documents and Settings\[username]\My Documents\My Pictures\"' maybe just "images\"
  Set Image1.Picture = LoadPicture(mstrPath & "Information.gif")
End Sub

Private Sub Image1_Click()
  MsgBox "button clicked"
End Sub

Private Sub Image1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  Set Image1.Picture = LoadPicture(mstrPath & "Question.gif")
End Sub

Private Sub Image1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  If Button <> 0 Then
    If X > 0 And X < Image1.Width _
    And Y > 0 And Y < Image1.Height Then
      If Not mbMouseOverImage Then
        Set Image1.Picture = LoadPicture(mstrPath & "Question.gif")
        mbMouseOverImage = True
      End If
    Else
      If mbMouseOverImage Then
        Set Image1.Picture = LoadPicture(mstrPath & "Information.gif")
        mbMouseOverImage = False
      End If
    End If
  End If
End Sub

Private Sub Image1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
  Set Image1.Picture = LoadPicture(mstrPath & "Information.gif")
End Sub

BTW
This would be much better served through a user-defined control.
--
For animations, you'll either need to set a timer that does similar to the above button example, but activated by the timer rather than mousedown/up, or again, create a user control to handle it.
0
 

Author Comment

by:sureshpodaralla
ID: 7146951
rspahitz, You are talking about buttons only.
How can I design a window. Normally all vb windows
are rectangle or square windows. I really need to design
a window with edges rounded or parabolice etc...
Do you think that windows media player designed the way
you explained?

Suresh
0
 
LVL 22

Expert Comment

by:rspahitz
ID: 7146963
You asked four questions combines into one:

How can I design:
1) beautiful windows like
that. Curly edges,
2) beautiful buttons
3) with beautiful colors
4) how can I animate


I answered #2 & #4
#3 is in the eye of the beholder.

For #1, if you do a search in the EE database, you will find references to making odd-shaped windows in VB. (Search for "transparent windows" or "rounded windows".)
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 16

Accepted Solution

by:
Richie_Simonetti earned 100 total points
ID: 7146999
0
 

Expert Comment

by:jhamlett
ID: 7147069
If you are referring to putting a skin on a window, there are some components you can buy that will let you skin your application. I quick search on the net for "skins" will give you plenty of pages to read. ActiveSkin is one I have tried, there may be others.
0
 
LVL 3

Expert Comment

by:ketapillar
ID: 7147351
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 7149330
Thanks for "A" grade. Glad to help you again.
Cheers
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

912 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

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now