Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Creating RGN of form

Creating RGN of form

Scheduled Pinned Locked Moved Visual Basic
questioncsharp
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    THEMYTH
    wrote on last edited by
    #1

    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

    W 1 Reply Last reply
    0
    • T THEMYTH

      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

      W Offline
      W Offline
      Wayne Phipps
      wrote on last edited by
      #2

      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

      T 1 Reply Last reply
      0
      • W 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

        T Offline
        T Offline
        THEMYTH
        wrote on last edited by
        #3

        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

        J 1 Reply Last reply
        0
        • T THEMYTH

          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

          J Offline
          J Offline
          J Dunlap
          wrote on last edited by
          #4

          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

          T 1 Reply Last reply
          0
          • J J Dunlap

            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

            T Offline
            T Offline
            THEMYTH
            wrote on last edited by
            #5

            THANK YOU regards Best Regards Emre YAZICI

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups