Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Shapes in .NET windows forms

Posted on 2004-04-02
5
Medium Priority
?
727 Views
Last Modified: 2009-12-16
Instead of default windows form how can I get the shape of the form to oval,circle etc .Is there any property I have to set? How can we achieve it?
0
Comment
Question by:sainavya1215
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 25

Expert Comment

by:RonaldBiemans
ID: 10739511
Here are some good examples

http://www.a1vbcode.com/code.asp?type=forms
0
 
LVL 25

Assisted Solution

by:RonaldBiemans
RonaldBiemans earned 400 total points
ID: 10739524
0
 
LVL 19

Accepted Solution

by:
Fahad Mukhtar earned 200 total points
ID: 10739527
Check these:

Easily create custom shaped forms without using any complicated code, it’s a simplest example how to do that.
https://www.exhedra.com/vb/scripts/ShowCode.asp?txtCodeId=1414&lngWId=10

Irregularly Shaped Forms in VB.NET
http://www.freevbcode.com/ShowCode.asp?ID=3723
0
 
LVL 28

Assisted Solution

by:iboutchkine
iboutchkine earned 400 total points
ID: 10740489
Ellipse form
when added to the Form's New method, will cause the form to
have an elliptical shape:

      Imports System.Drawing.Drawing2D
      
      Public Sub New()
            MyBase.New()
            InitializeComponent()
            

'add this part
            'Create the elliptical form
            Dim gPath As GraphicsPath = New GraphicsPath()
            gPath.AddEllipse(0, 0, Me.ClientSize.Width, Me.ClientSize.Height)
            Me.Region = New Region(gPath)
      End Sub
=============================
Round form
 'Place this in your form's initlialization procedure:

       'after the line
       'Add any initialization after the InitializeComponent() call


        Dim intDiameter As Integer = 300
        Me.Height = intDiameter
        Me.Width = intDiameter
        Dim p As New Drawing2D.GraphicsPath()
        p.AddEllipse(0, 0, intDiameter, intDiameter)
        Me.Region = New Region(p)
        Me.BackColor = Color.Red
=================================
donut shape
To change the region of a form, create a region from a set of graphics paths and apply this to the form’s
Region property. The following code shows how to do this:


      Imports System.Drawing.Drawing2D
      
      Public Sub New()
            MyBase.New()
            InitializeComponent()
            

'add this part

Dim myPath As New Drawing2D.GraphicsPath()
Dim bigDiameter As Integer = Me.ClientSize.Height
Dim donutWidth As Integer = 80
myPath.AddEllipse(0, 0, bigDiameter, bigDiameter)
myPath.AddEllipse(donutWidth, donutWidth, _
   bigDiameter - (donutWidth * 2), _
   bigDiameter - (donutWidth * 2))
Me.Region = New Region(myPath)

etc etc etc
0
 

Author Comment

by:sainavya1215
ID: 10743012
Thx a lot
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

IP addresses can be stored in a database in any of several ways.  These ways may vary based on the volume of the data.  I was dealing with quite a large amount of data for user authentication purpose, and needed a way to minimize the storage.   …
Summary Displaying images in RichTextBox is a common requirement with limited solutions available. Pasting through clipboard or embedding into RTF content only support static images.  This article describes how to insert Windows control objects int…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question