By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,694 Members | 1,332 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,694 IT Pros & Developers. It's quick & easy.

Create Region Form

P: n/a
Hello,
I want to create non-rectengular/region form in
VB.NET. Please Help Me..............
Jigar Patel
Nov 20 '05 #1
Share this Question
Share on Google+
15 Replies


P: n/a
"Jigar Patel" <pa**********@hotmail.com> schrieb
Hello,
I want to create non-rectengular/region form in
VB.NET. Please Help Me..............


I would create the region and assign it to the Form's region property...
Dim gp As New System.Drawing.Drawing2D.GraphicsPath
Dim rgn As Region
gp.AddEllipse(0, 0, 100, 100)
rgn = New Region(gp)
Me.Region = rgn
gp.Dispose()

--
Armin

Nov 20 '05 #2

P: n/a
Hello,

"Jigar Patel" <pa**********@hotmail.com> schrieb:
I want to create non-rectengular/region form in
VB.NET. Please Help Me..............


See (complete thread):

http://groups.google.de/groups?selm=...TNGP10.phx.gbl

-- or --

Have a look at the form's 'TransparencyKey' property (supported on Windows
2000+) (see MSDN documentation).

--
Herfried K. Wagner
MVP VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #3

P: n/a
Hello Jigar,

This snippet comes courtesy of our Herfried:

Private Sub Form1_Load (ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
Me.Size = New Size (700, 400)
Dim g As New System.Drawing.Drawing2D.GraphicsPath()
g.AddString ("Jigar", _
System.Drawing.FontFamily.GenericSansSerif, _
System.Drawing.FontStyle.Bold, _
150, _
New Point (50, 50), _
System.Drawing.StringFormat.GenericDefault _
)
Me.BackColor = Color.Red
Me.Region = New System.Drawing.Region(g)
End Sub

Paste this into a new project - you'll love it!! ;-)

Regards,
Fergus
Nov 20 '05 #4

P: n/a
Hello,

"Fergus Cooney" <fi******@tesco.net> schrieb:
This snippet comes courtesy of our Herfried:

Private Sub Form1_Load (ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
Me.Size = New Size (700, 400)
Dim g As New System.Drawing.Drawing2D.GraphicsPath()
g.AddString ("Jigar", _
System.Drawing.FontFamily.GenericSansSerif, _
System.Drawing.FontStyle.Bold, _
150, _
New Point (50, 50), _
System.Drawing.StringFormat.GenericDefault _
)
Me.BackColor = Color.Red
Me.Region = New System.Drawing.Region(g)
\\\
g.Dispose()
///
End Sub


--
Herfried K. Wagner
MVP VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #5

P: n/a
Hi Herfried,

AAAARRGGH

ROFL

But my excuse is that I cut and pasted your example completely. ;-b

Regards,
Fergus
Nov 20 '05 #6

P: n/a
Hello,

"Fergus Cooney" <fi******@tesco.net> schrieb:
But my excuse is that I cut and pasted your example
completely. ;-b


I think the brainconnector has a bug.

;-)

--
Herfried K. Wagner
MVP VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #7

P: n/a
Cor
Hi Fergus (Herfried)
You did not, even without understanding the code or testing it, I see a red
Jigar in the left uper side in to small letters where was before another
name. You know that this message would come.
:-)))
Cor
Nov 20 '05 #8

P: n/a
LOL
Nov 20 '05 #9

P: n/a
Hi Cor,

I've been rumbled* :-(

Sure I tested it. :-) When I tried the original it was small so I made
this one bigger for Jigar and, as you spotted, used his name. (That's why I
think he'll love it!)

But each time Herfried reminds me, it sinks into my brain a bit better.
:-)

Lol

Regards,
Fergus

* rumbled - discovered, caught out.
Nov 20 '05 #10

P: n/a
Cor
Hi Fergus,
I go see Ajax maybe I be back tonight I said to Dan I would maybe test the
cookies, that intrest me.
My computer did not work well last three days.
I think I have fixed it now.
CY
Cor
Nov 20 '05 #11

P: n/a
Hello,

"Fergus Cooney" <fi******@tesco.net> schrieb:
LOL


I am working on a patch.

;-)

--
Herfried K. Wagner
MVP VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #12

P: n/a
Hello,

"Fergus Cooney" <fi******@tesco.net> schrieb:
Sure I tested it. :-) When I tried the original it was small
so I made this one bigger for Jigar and, as you spotted,
used his name. (That's why I think he'll love it!)


Ah, I didn't realize that you have manipulated the code and included Jigar's
name...

;-)

--
Herfried K. Wagner
MVP VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #13

P: n/a
Hello,

"Fergus Cooney" <fi******@tesco.net> schrieb:
Cor's been eating his carrots.
Did he tell you that on the telephone?
You've been borrowing Armin's glasses!


No, I have my own glasses...

;-)))

--
Herfried K. Wagner
MVP VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #14

P: n/a
Hello,

"Fergus Cooney" <fi******@tesco.net> schrieb:
I think you'll find those ones with the tiny holes are good -
they let the skin breathe.


Maybe we can use a wireless connection via Bluetooth.

;-)

--
Herfried K. Wagner
MVP VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #15

P: n/a
Here is a link that lets you "draw the form boudaries and it generates the
code for you to see, i do not lik egenerators but this is pretty simple, but
you would have to clean it up a bit before use.

http://www.franklins.net/dotnet/ Shaped forms. down at the bottom

"Cor" <no*@non.com> wrote in message
news:3f***********************@reader21.wxs.nl...
Hi Fergus,
I go see Ajax maybe I be back tonight I said to Dan I would maybe test the
cookies, that intrest me.
My computer did not work well last three days.
I think I have fixed it now.
CY
Cor

Nov 20 '05 #16

This discussion thread is closed

Replies have been disabled for this discussion.