473,662 Members | 2,536 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Simply round corners of a form

I am looking for a way in vb.net to take a form with sharp corners and just
round off the corners a bit so they arent so sharp.

I have seen this done in other applications.
Nov 20 '05 #1
18 42216
Put a panel on the form and then make the form tranparent. You can add the
controls over the panel.

OHM

Mike D wrote:
I am looking for a way in vb.net to take a form with sharp corners
and just round off the corners a bit so they arent so sharp.

I have seen this done in other applications.

Nov 20 '05 #2
* "Mike D" <di****@hotmail .com> scripsit:
I am looking for a way in vb.net to take a form with sharp corners and just
round off the corners a bit so they arent so sharp.

I have seen this done in other applications.


Quick and dirty:

\\\
Me.FormBorderSt yle = FormBorderStyle .None
Me.Height = 300
Me.Width = 400
Dim p As New Drawing2D.Graph icsPath()
p.StartFigure()
p.AddArc(New Rectangle(0, 0, 40, 40), 180, 90)
p.AddLine(40, 0, Me.Width - 40, 0)
p.AddArc(New Rectangle(Me.Wi dth - 40, 0, 40, 40), -90, 90)
p.AddLine(Me.Wi dth, 40, Me.Width, Me.Height - 40)
p.AddArc(New Rectangle(Me.Wi dth - 40, Me.Height - 40, 40, 40), 0, 90)
p.AddLine(Me.Wi dth - 40, Me.Height, 40, Me.Height)
p.AddArc(New Rectangle(0, Me.Height - 40, 40, 40), 90, 90)
p.CloseFigure()
Me.Region = New Region(p)
Me.BackColor = Color.Red
///

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #3
Forget my post, it was untested and simply incorrect.

Sorry - OHM
One Handed Man wrote:
Put a panel on the form and then make the form tranparent. You can
add the controls over the panel.

OHM

Mike D wrote:
I am looking for a way in vb.net to take a form with sharp corners
and just round off the corners a bit so they arent so sharp.

I have seen this done in other applications.

Nov 20 '05 #4
WOW. I was thinking that there was something quick and simple. But I highly
appreciate the technical approach, Realizing that all things dont come in
quick and dirty flavors
"Herfried K. Wagner [MVP]" <hi************ ***@gmx.at> wrote in message
news:bp******** *****@ID-208219.news.uni-berlin.de...
* "Mike D" <di****@hotmail .com> scripsit:
I am looking for a way in vb.net to take a form with sharp corners and just round off the corners a bit so they arent so sharp.

I have seen this done in other applications.


Quick and dirty:

\\\
Me.FormBorderSt yle = FormBorderStyle .None
Me.Height = 300
Me.Width = 400
Dim p As New Drawing2D.Graph icsPath()
p.StartFigure()
p.AddArc(New Rectangle(0, 0, 40, 40), 180, 90)
p.AddLine(40, 0, Me.Width - 40, 0)
p.AddArc(New Rectangle(Me.Wi dth - 40, 0, 40, 40), -90, 90)
p.AddLine(Me.Wi dth, 40, Me.Width, Me.Height - 40)
p.AddArc(New Rectangle(Me.Wi dth - 40, Me.Height - 40, 40, 40), 0, 90)
p.AddLine(Me.Wi dth - 40, Me.Height, 40, Me.Height)
p.AddArc(New Rectangle(0, Me.Height - 40, 40, 40), 90, 90)
p.CloseFigure()
Me.Region = New Region(p)
Me.BackColor = Color.Red
///

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

Nov 20 '05 #5
What does the 'P' reffence? I am doing this in vb.net if that helps any?
"Herfried K. Wagner [MVP]" <hi************ ***@gmx.at> wrote in message
news:bp******** *****@ID-208219.news.uni-berlin.de...
* "Mike D" <di****@hotmail .com> scripsit:
I am looking for a way in vb.net to take a form with sharp corners and just round off the corners a bit so they arent so sharp.

I have seen this done in other applications.


Quick and dirty:

\\\
Me.FormBorderSt yle = FormBorderStyle .None
Me.Height = 300
Me.Width = 400
Dim p As New Drawing2D.Graph icsPath()
p.StartFigure()
p.AddArc(New Rectangle(0, 0, 40, 40), 180, 90)
p.AddLine(40, 0, Me.Width - 40, 0)
p.AddArc(New Rectangle(Me.Wi dth - 40, 0, 40, 40), -90, 90)
p.AddLine(Me.Wi dth, 40, Me.Width, Me.Height - 40)
p.AddArc(New Rectangle(Me.Wi dth - 40, Me.Height - 40, 40, 40), 0, 90)
p.AddLine(Me.Wi dth - 40, Me.Height, 40, Me.Height)
p.AddArc(New Rectangle(0, Me.Height - 40, 40, 40), 90, 90)
p.CloseFigure()
Me.Region = New Region(p)
Me.BackColor = Color.Red
///

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

Nov 20 '05 #6
froget my last post asking what the 'P' reffrenced. I was trying to first
create a module that I could access from all my forms, However it all
errored out. I placed the code in the form load event and all worked fine.
"Herfried K. Wagner [MVP]" <hi************ ***@gmx.at> wrote in message
news:bp******** *****@ID-208219.news.uni-berlin.de...
* "Mike D" <di****@hotmail .com> scripsit:
I am looking for a way in vb.net to take a form with sharp corners and just round off the corners a bit so they arent so sharp.

I have seen this done in other applications.


Quick and dirty:

\\\
Me.FormBorderSt yle = FormBorderStyle .None
Me.Height = 300
Me.Width = 400
Dim p As New Drawing2D.Graph icsPath()
p.StartFigure()
p.AddArc(New Rectangle(0, 0, 40, 40), 180, 90)
p.AddLine(40, 0, Me.Width - 40, 0)
p.AddArc(New Rectangle(Me.Wi dth - 40, 0, 40, 40), -90, 90)
p.AddLine(Me.Wi dth, 40, Me.Width, Me.Height - 40)
p.AddArc(New Rectangle(Me.Wi dth - 40, Me.Height - 40, 40, 40), 0, 90)
p.AddLine(Me.Wi dth - 40, Me.Height, 40, Me.Height)
p.AddArc(New Rectangle(0, Me.Height - 40, 40, 40), 90, 90)
p.CloseFigure()
Me.Region = New Region(p)
Me.BackColor = Color.Red
///

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

Nov 20 '05 #7
Nice post - neither quick nor dirty but definitely way cool.
"Herfried K. Wagner [MVP]" <hi************ ***@gmx.at> wrote in message
news:bp******** *****@ID-208219.news.uni-berlin.de...
* "Mike D" <di****@hotmail .com> scripsit:
I am looking for a way in vb.net to take a form with sharp corners and just round off the corners a bit so they arent so sharp.

I have seen this done in other applications.


Quick and dirty:

\\\
Me.FormBorderSt yle = FormBorderStyle .None
Me.Height = 300
Me.Width = 400
Dim p As New Drawing2D.Graph icsPath()
p.StartFigure()
p.AddArc(New Rectangle(0, 0, 40, 40), 180, 90)
p.AddLine(40, 0, Me.Width - 40, 0)
p.AddArc(New Rectangle(Me.Wi dth - 40, 0, 40, 40), -90, 90)
p.AddLine(Me.Wi dth, 40, Me.Width, Me.Height - 40)
p.AddArc(New Rectangle(Me.Wi dth - 40, Me.Height - 40, 40, 40), 0, 90)
p.AddLine(Me.Wi dth - 40, Me.Height, 40, Me.Height)
p.AddArc(New Rectangle(0, Me.Height - 40, 40, 40), 90, 90)
p.CloseFigure()
Me.Region = New Region(p)
Me.BackColor = Color.Red
///

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

Nov 20 '05 #8
This works but does'nt. If I resize my form. I lose the formatiing. Is there
no way for me to keep the rounded corners when resizing?
"Mike D" <di****@hotmail .com> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
I am looking for a way in vb.net to take a form with sharp corners and just round off the corners a bit so they arent so sharp.

I have seen this done in other applications.

Nov 20 '05 #9
Hi Mike,

Try this:
Me.FormBorderSt yle = FormBorderStyle .None

' this would make the form purely the designated color, without

' the control or windowstate menus and without a caption, drag top, icon,
etc.

Me.Height = 688

Me.Width = 360

Dim p As New Drawing2D.Graph icsPath

p.StartFigure()

p.AddArc(New Rectangle(0, 0, 40, 40), 180, 90)

p.AddLine(40, 0, Me.Width - 40, 0)

p.AddArc(New Rectangle(Me.Wi dth - 40, 0, 40, 40), -90, 90)

p.AddLine(Me.Wi dth, 40, Me.Width, Me.Height - 40)

p.AddArc(New Rectangle(Me.Wi dth - 40, Me.Height - 40, 40, 40), 0, 90)

p.AddLine(Me.Wi dth - 40, Me.Height, 40, Me.Height)

p.AddArc(New Rectangle(0, Me.Height - 40, 40, 40), 90, 90)

p.CloseFigure()

Me.Region = New Region(p)

Me.BackColor = Color.Thistle

HTH,

Bernie Yaeger

"Mike D" <di****@hotmail .com> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
I am looking for a way in vb.net to take a form with sharp corners and just round off the corners a bit so they arent so sharp.

I have seen this done in other applications.

Nov 20 '05 #10

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

Similar topics

5
33323
by: reneeccwest | last post by:
is there any way I can make the 4 end of table with round corner without using any images? <table border=1> <tr><td>I wanna be a round table</td></tr> </table>
3
14446
by: Kerberos | last post by:
I haven't found in my CSS book how to create a gradient to fill a division tag, and to create a border with round corners. Is it possible using either CSS or JavaScript? I'd like to create a menu bar with a gradient in the background, and I want the top corners to be a little round with a 5px radius. Thanks, -- Kerberos.
2
5757
by: deepakp | last post by:
Hi, I'm trying to create a site index page. The page layout will consist of a header, left navigation and content display. The left navigation and content display should look like the image file pasted at the bottom of this page http://www.open365test.net/index_test.html I created a stylesheet for the list items as shown at the top of the
17
8605
by: Barret Bonden | last post by:
As an old programmer just now looking at VB.net I have a question: How does one simply open one form from another ? I don't mean how does one create a new instance of that form , but rather how to refer to THAT form ? And having done this, how does one get data to and from that form ? I have read the MS tutorial on this but it is senselessly complex; there must be a simple, straightforward method, or I can only assume that MS has...
0
3589
by: Nik Coughlin | last post by:
Something that I've been trying to do for a long time is a 3 column layout where all three columns have equal height, and have rounded corners implemented using PNGs with alpha. One of my early attempts is here: http://www.nrkn.com/3ColRoundAlpha/ It shows a bunch of different methods that I tried. You'll see that not only is there a hell of a lot of nesting of divs, but the page is very slow to load because there are a lot of image...
2
1616
by: virgil46 | last post by:
Trying to use niftycube that i downloaded from the web to round corner's on my webpage's. It is not working though. I'm using, "Web Expressions", as my editor.
5
2214
by: todpeeple | last post by:
Hi can any one plz tell me urgently... is it possible to make round corners of any box (such as <div>, <span>,<table>, or any box) in asp .net page programatically or declareatively without using the graphic image... if yes then plz send me the code for that... Regards Tod
0
8432
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8857
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8764
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...
1
8546
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8633
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
5654
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
4180
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
4347
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1993
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.