Creating RGN of form
-
Hello coders, You know in VB6 there were some apis like CreateREctRgn CreateEllipticRgn ... Is there any equivalent in VB.NET of one of those? How do I use them? Thank you Have a nice day Best Regards Emre YAZICI
The following code can be used to change the shape of a control. It may give you some ideas about how to use regions: Dim intDiameter As Integer = 200 Me.Height = intDiameter Me.Width = intDiameter Dim p As New Drawing2D.GraphicsPath() p.AddEllipse(0, 0, intDiameter, intDiameter) Me.Region = New Region(p) Hope it helps Regards Wayne Phipps
-
The following code can be used to change the shape of a control. It may give you some ideas about how to use regions: Dim intDiameter As Integer = 200 Me.Height = intDiameter Me.Width = intDiameter Dim p As New Drawing2D.GraphicsPath() p.AddEllipse(0, 0, intDiameter, intDiameter) Me.Region = New Region(p) Hope it helps Regards Wayne Phipps
Thank you very much.. I have another problem. How can I combine two or more RGNs? Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim intDiameter As Integer = 200 Me.Height = intDiameter Me.Width = intDiameter Dim p As New Drawing2D.GraphicsPath() Dim r As New System.Drawing.Rectangle(0, 0, 80, 80) p.AddRectangle(r) p.AddEllipse(0, 0, intDiameter, intDiameter) Me.Region = New Region(p) End Sub But there is a problem. It cuts off the region (which already created before) There was an api called CombineRgn in the api there was a mode that you can set the combining property Best Regards Emre YAZICI
-
Thank you very much.. I have another problem. How can I combine two or more RGNs? Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim intDiameter As Integer = 200 Me.Height = intDiameter Me.Width = intDiameter Dim p As New Drawing2D.GraphicsPath() Dim r As New System.Drawing.Rectangle(0, 0, 80, 80) p.AddRectangle(r) p.AddEllipse(0, 0, intDiameter, intDiameter) Me.Region = New Region(p) End Sub But there is a problem. It cuts off the region (which already created before) There was an api called CombineRgn in the api there was a mode that you can set the combining property Best Regards Emre YAZICI
It's been divided into 5 methods: Region.Complement Region.Xor Region.Union Region.Exclude Region.Intersect So instead of:
Me.Region = New Region(p)
do:
Me.Region.Complement(p)
"Do unto others as you would have them do unto you." - Jesus
"An eye for an eye only makes the whole world blind." - Mahatma Gandhi -
It's been divided into 5 methods: Region.Complement Region.Xor Region.Union Region.Exclude Region.Intersect So instead of:
Me.Region = New Region(p)
do:
Me.Region.Complement(p)
"Do unto others as you would have them do unto you." - Jesus
"An eye for an eye only makes the whole world blind." - Mahatma Gandhi