473,670 Members | 2,448 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1559
* "=?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******** *************** ***********@mic rosoft.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 CreateEllipticR gn Lib "gdi32" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Lon
Private Declare Function CreatePolygonRg n 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******@hotmai l.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 = CreatePolygonRg n(PointRgn(0), 8, 1
CircA = CreateEllipticR gn(0, 0, lArc, lArc
CircB = CreateEllipticR gn(W, 0, W - lArc, lArc
CircC = CreateEllipticR gn(W, H, W - lArc, H - lArc
CircD = CreateEllipticR gn(0, H, lArc, H - lArc

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

RndRect = SetWindowRgn(hW nd, 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 SetDIBitsToDevi ce 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******** *************** ***********@mic rosoft.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

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3754
by: Greg Bacchus | last post by:
Hi, I'm getting an exception that really has me stumped. It's sporadic at best, it's only happened a handful of times. This particular time it happened when the user pressed 'Alt-S' to save the data that they were entering. Following is all exception information. Any thoughts much appreciated. Cheers
15
3863
by: Wiktor Zychla | last post by:
today we've found a critical issue regarding the ListView from Windows.Forms. it was confirmed on several machines with Win2K and XP. here's the problem: create a ListView with about 50000 rows. now use task manager to see the GDI usage of the process. everything seems normal. now catch the ListView's scroller and start to move it downwards. you have to hold the constant speed so that the ListView is constantly repainted. look at the...
7
2631
by: Tyler Foreman | last post by:
Hello, I have a strange problem that occurs every so often in my application. It usually takes place when I hide one form and activate another. What happens is I get the following exception: System.ArgumentException occured in System.Windows.Forms.dll
1
3447
by: Scott Davies | last post by:
Hi, I'm looking for some help on a small program that I'm trying to develop in VB.NET. I'm having trouble getting the code that I've written to work, can anyone shed some light as to where I'm going wrong. The program has been written to do the following tasks: - Select remote server - Select from two specific services
0
3931
by: Scott Davies | last post by:
Hi, I'm looking for some help on a small program that I'm trying to develop in VB.NET. The program I'm trying to develop needs to be able to do the following: - Select remote server - Select from two specific services - Check the status of the server
4
3148
by: Rod Gill | last post by:
Hi, I have a form that when opened in the designer appears of the screen. The form selector can't be dragged (or resized) and if I scroll right and down to centralise it the form simply jumps further away, completely leaving the selector box area. Any ideas? VS 2003 and VB.Net This is a simple application at the moment but the form is inherited from a
4
4175
by: tshad | last post by:
What would be a good way to check programmatically whether a service was running? We have a service that dies periodically and I need to check to see if this service is running. I know how to check to see if the status is in stopped or running mode. But that doesn't tell me if it is actually running. I need to know this so that if it happens I can programmatically start the same service on another machine.
1
7833
by: mfunkmann | last post by:
Hi, I recently got an error and I don't know how to fix it: Error 1 'System.Data.DataColumn' does not contain a definition for 'Windows' C:\c#\CsharpPRO\Form1.Designer.cs 304 77 CsharpPRO I am note sure what to do because all propertiers work, except the System.Data.DataColumn.. I didn't write any code by hand and used the visual studio to set the properties..
21
3340
by: Dan Tallent | last post by:
In my application I have a form (Customer) that I want to be able to open multiple copies at once. Within this form I have other forms that can be opened. Example: ZipCode. When the user enters a zipcode that is unknown this form will open. I don't want users to modify any of this customers data until they close the zipcode form. Normally this can accomplished using a modal form, however this prevents me from opening a new copy of...
0
8813
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8659
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7412
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5683
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4208
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4388
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2799
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2037
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1791
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.