468,241 Members | 1,522 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,241 developers. It's quick & easy.

Softer Windows Forms

I've noticed that a lot of programs have began to use a "softer" windows form. By that I mean the caption bar has lighter, softer colors and the corners are more rounded

How do you go about getting that look in a Visual Basic application? (v6 or .NET

Thanks~
Nov 20 '05 #1
16 1309
* "=?Utf-8?B?SWNlZENyb3c=?=" <ch********@aol.com> scripsit:
I've noticed that a lot of programs have began to use a "softer"
windows form. By that I mean the caption bar has lighter, softer colors
and the corners are more rounded.


I have never seen such an application.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #2
if you mean forms like Roxio's CD-Creator 6 has, that's all custom drawn.
"IcedCrow" <ch********@aol.com> wrote in message
news:C7**********************************@microsof t.com...
I've noticed that a lot of programs have began to use a "softer" windows form. By that I mean the caption bar has lighter, softer colors and the
corners are more rounded.
How do you go about getting that look in a Visual Basic application? (v6 or .NET)
Thanks~

Nov 20 '05 #3
To get rounded corners try the following code in a module (.bas): [VB6

Private Declare Function GetWindowRect Lib "user32" (ByVal hWnd As Long, lpRect As RECT) As Lon
Private Declare Function SetWindowRgn Lib "user32" (ByVal hWnd As Long, ByVal hRgn As Long, ByVal bRedraw As Boolean) As Lon
Private Declare Function CombineRgn Lib "gdi32" (ByVal hDestRgn As Long, ByVal hSrcRgn1 As Long, ByVal hSrcRgn2 As Long, ByVal nCombineMode As Long) As Lon
Private Declare Function CreateEllipticRgn Lib "gdi32" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Lon
Private Declare Function CreatePolygonRgn Lib "gdi32" (lpPoint As POINTAPI, ByVal nCount As Long, ByVal nPolyFillMode As Long) As Lon

Private Type POINTAP
X As Lon
Y As Lon
End Typ

Private Type REC
Left As Lon
Top As Lon
Right As Lon
Bottom As Lon
End Typ

Public Function RndRect(ByVal hWnd As Long, ByVal Arc As Long, Optional ByVal Redraw As Boolean = True) As Lon

' Written By: COD3B453 [co******@hotmail.com
' Legal: This comment MUST remain in this code snippe
' Description: Set window region so that it has rounded corner

Dim PointRgn(0 To 7) As POINTAP
Dim PolyRgn As Lon
Dim CircA As Lon
Dim CircB As Lon
Dim CircC As Lon
Dim CircD As Lon
Dim lArc As Lon
Dim W As Lon
Dim H As Lon
Dim wRect As REC

lArc = 2 * Ar
GetWindowRect hWnd, wRec
W = wRect.Right - wRect.Lef
H = wRect.Bottom - wRect.To

PointRgn(0).X = Ar
PointRgn(0).Y =

PointRgn(1).X = W - Ar
PointRgn(1).Y =

PointRgn(2).X =
PointRgn(2).Y = Ar

PointRgn(3).X =
PointRgn(3).Y = H - Ar

PointRgn(4).X = W - Ar
PointRgn(4).Y =

PointRgn(5).X = Ar
PointRgn(5).Y =

PointRgn(6).X =
PointRgn(6).Y = H - Ar

PointRgn(7).X =
PointRgn(7).Y = Ar

PolyRgn = CreatePolygonRgn(PointRgn(0), 8, 1
CircA = CreateEllipticRgn(0, 0, lArc, lArc
CircB = CreateEllipticRgn(W, 0, W - lArc, lArc
CircC = CreateEllipticRgn(W, H, W - lArc, H - lArc
CircD = CreateEllipticRgn(0, H, lArc, H - lArc

CombineRgn PolyRgn, PolyRgn, CircA,
CombineRgn PolyRgn, PolyRgn, CircB,
CombineRgn PolyRgn, PolyRgn, CircC,
CombineRgn PolyRgn, PolyRgn, CircD,

RndRect = SetWindowRgn(hWnd, PolyRgn, Redraw

End Functio

NOTE
'hWnd' should be the form's hwnd propert
'Arc' should be the radius of the curved corners in pixel
'Redraw' is optional and doesn't really matter too muc

Changing the colour of the caption bar is much harder, using the SetDIBitsToDevice API can do this but you have to override the window process for the form so that it doesn't draw the default one back on it

good luc

cod3b453
Nov 20 '05 #4
Not having run anything that I've developed in XP I'm guessing, but are you
talking about just the standard XP 'look'?
"IcedCrow" <ch********@aol.com> wrote in message
news:C7**********************************@microsof t.com...
I've noticed that a lot of programs have began to use a "softer" windows form. By that I mean the caption bar has lighter, softer colors and the
corners are more rounded.
How do you go about getting that look in a Visual Basic application? (v6 or .NET)
Thanks~

Nov 20 '05 #5
Perhaps its even the new Microsoft Office look...
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:c6************@ID-208219.news.uni-berlin.de...
* "=?Utf-8?B?SWNlZENyb3c=?=" <ch********@aol.com> scripsit:
I've noticed that a lot of programs have began to use a "softer"
windows form. By that I mean the caption bar has lighter, softer colors
and the corners are more rounded.


I have never seen such an application.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>

Nov 20 '05 #6
* "CJ Taylor" <[cege] at [tavayn] dit commmmm> scripsit:
Perhaps its even the new Microsoft Office look...


This look still doesn't change the border and buttons of a form.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #7
*Perhaps*

I don't know what else to suggest. =)
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:c6************@ID-208219.news.uni-berlin.de...
* "CJ Taylor" <[cege] at [tavayn] dit commmmm> scripsit:
Perhaps its even the new Microsoft Office look...


This look still doesn't change the border and buttons of a form.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>

Nov 20 '05 #8
Check out the new Yahoo Messager (Beta) for an example. The borders are rounded, the buttons are rounded, the colors softer

I am running windows 2000 at work so it's not an XP thing, though I notice XP has this as well.
Nov 20 '05 #9
I just realized maybe it's not good for me to comment on colors given that
I'm color blind and all. ;)

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:c6************@ID-208219.news.uni-berlin.de...
* "CJ Taylor" <[cege] at [tavayn] dit commmmm> scripsit:
Perhaps its even the new Microsoft Office look...


This look still doesn't change the border and buttons of a form.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>

Nov 20 '05 #10
* "=?Utf-8?B?SWNlZENyb3c=?=" <an*******@discussions.microsoft.com> scripsit:
Check out the new Yahoo Messager (Beta) for an example. The borders are rounded, the buttons are rounded, the colors softer.

I am running windows 2000 at work so it's not an XP thing, though I notice XP has this as well.


I think these applications will use their own UI frameworks.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #11
Surely that makes you better placed than most? Which is the most useful
feedback about a UI?

"I like the colours."
"I don't like the colours."
"What UI?"

"CJ Taylor" <[cege] at [tavayn] dit commmmm> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
I just realized maybe it's not good for me to comment on colors given that
I'm color blind and all. ;)

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:c6************@ID-208219.news.uni-berlin.de...
* "CJ Taylor" <[cege] at [tavayn] dit commmmm> scripsit:
Perhaps its even the new Microsoft Office look...


This look still doesn't change the border and buttons of a form.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>


Nov 20 '05 #12
http://www.dotnetpowertools.com/PerfectForm.aspx
Don't know if you seen this UI framework for sale. I looked at it, looks
kinda intersting. =)

-CJ
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:c6************@ID-208219.news.uni-berlin.de...
* "=?Utf-8?B?SWNlZENyb3c=?=" <an*******@discussions.microsoft.com> scripsit:
Check out the new Yahoo Messager (Beta) for an example. The borders are rounded, the buttons are rounded, the colors softer.
I am running windows 2000 at work so it's not an XP thing, though I

notice XP has this as well.
I think these applications will use their own UI frameworks.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>

Nov 20 '05 #13
Hi Iced,

I thought I did not see *region* in this thread, do not know if you want it,
however maybe it gives you an idea.

Cor
\\\made by Herfried. K. Wagner, Fergus Cooney and Cor Ligthert
Private WithEvents button1 As New Button
Private Sub Form1_Load(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
Dim g As New System.Drawing.Drawing2D.GraphicsPath
g.AddString( _
"Iced", _
System.Drawing.FontFamily.GenericSansSerif, _
System.Drawing.FontStyle.Bold, _
200, _
New Point(0, 0), _
System.Drawing.StringFormat.GenericDefault _
)
Me.BackColor = Color.Red
Me.Region = New System.Drawing.Region(g)
g.Dispose()
Me.AutoScaleBaseSize = New System.Drawing.Size(0, 0)
Me.ClientSize = New System.Drawing.Size(800, 200)
button1.BackColor = System.Drawing.SystemColors.ActiveCaptionText
button1.ForeColor = System.Drawing.Color.Black
button1.Location = New System.Drawing.Point(50, 40)
button1.Size = New System.Drawing.Size(20, 20)
Me.Controls.Add(button1)
button1.Text = "X"
End Sub
Private Sub Button1_Click(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles button1.Click
Me.Close()
End Sub
///
Nov 20 '05 #14
* "CJ Taylor" <cege at the123 dont use this part till here tavayn dot com> scripsit:
http://www.dotnetpowertools.com/PerfectForm.aspx

Don't know if you seen this UI framework for sale. I looked at it, looks
kinda intersting. =)


I missed screenshots on the website...

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #15

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:c6************@ID-208219.news.uni-berlin.de...
* "CJ Taylor" <cege at the123 dont use this part till here tavayn dot com> scripsit:
http://www.dotnetpowertools.com/PerfectForm.aspx

Don't know if you seen this UI framework for sale. I looked at it, looks kinda intersting. =)


I missed screenshots on the website...


Yes.. less the screenshots... it looked good.

=)
--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>

Nov 20 '05 #16
* "CJ Taylor" <[cege] at [tavayn] dit commmmm> scripsit:
http://www.dotnetpowertools.com/PerfectForm.aspx

Don't know if you seen this UI framework for sale. I looked at it,
looks
kinda intersting. =)


I missed screenshots on the website...


Yes.. less the screenshots... it looked good.

=)


Even for color-blind :-).

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #17

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by Tyler Foreman | last post: by
1 post views Thread by Scott Davies | last post: by
reply views Thread by Scott Davies | last post: by
4 posts views Thread by Rod Gill | last post: by
4 posts views Thread by tshad | last post: by
21 posts views Thread by Dan Tallent | last post: by
reply views Thread by kermitthefrogpy | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.