Create Region Form

  • Thread starter Thread starter Jigar Patel
  • Start date Start date
J

Jigar Patel

Hello,
I want to create non-rectengular/region form in
VB.NET. Please Help Me..............


Jigar Patel
 
Jigar Patel said:
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()
 
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
 
Hello,

Fergus Cooney said:
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
 
Hi Herfried,

AAAARRGGH

ROFL

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

Regards,
Fergus
 
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
 
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.
 
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
 
Hello,

Fergus Cooney said:
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...

;-)
 
Hello,

Fergus Cooney said:
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.

;-)
 
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
 
Back
Top