Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4072440
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T16:53:06+00:00 2026-05-20T16:53:06+00:00

I am in real troubles: I want to create a Windows form application in

  • 0

I am in real troubles: I want to create a Windows form application in VB.NET 2008, and I want to create a circle-shaped window.
How can I do it? Can anyone help me?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T16:53:07+00:00Added an answer on May 20, 2026 at 4:53 pm

    Some things you have to do to make this work properly. First off, it is important to wait until the OnLoad() method runs. Only then do you know how large the window got. It won’t be the design size on another machine when the user runs the video adapter at a different DPI. You’ll also have to remove the border and caption, they no longer work well when you give the window a shape. Which leaves it up to you to re-implement the work they do. At a minimum you’d want to allow the user to still move the window.

    A sample form that does this:

    Public Class Form1
        Public Sub New()
            InitializeComponent()
            Me.FormBorderStyle = Windows.Forms.FormBorderStyle.None
            Me.DoubleBuffered = True
        End Sub
    
        Protected Overrides Sub OnLoad(ByVal e As System.EventArgs)
            '' Set window shape
            Using path As New System.Drawing.Drawing2D.GraphicsPath
                path.AddEllipse(0, 0, Me.ClientSize.Width, Me.ClientSize.Height)
                Me.Region = New Region(path)
            End Using
            MyBase.OnLoad(e)
        End Sub
    
        Private Const WM_NCHITTEST As Integer = &H84
        Private Const HTCLIENT As Integer = 1
        Private Const HTCAPTION As Integer = 2
        Private Const CaptionHeight As Integer = 30
    
        Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
            MyBase.WndProc(m)
            '' Detect clicks at top of window to allow it to be moved
            If m.Msg = &H84 AndAlso m.Result.ToInt32() = HTCLIENT Then
                Dim pos As Point = New Point(m.LParam.ToInt32())
                pos = Me.PointToClient(pos)
                If pos.Y < CaptionHeight Then m.Result = CType(HTCAPTION, IntPtr)
            End If
        End Sub
    
        Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
            '' Draw a simple caption
            e.Graphics.FillRectangle(Brushes.Blue, 0, 0, Me.ClientSize.Width, CaptionHeight)
            MyBase.OnPaint(e)
        End Sub
    End Class
    

    Use this as a starting point to implement your own window chrome. You’ll probably want to add a glyph that lets the user close the window. The BackgroundImage property is a good way to give the window a ‘texture’. Or modify OnPaint() to draw your own.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I write ASP.NET application and I want to use jQuery DataTables. In Master Page
I've got a real trouble now. I've got my win Application and a lot
I have some trouble achieving adequate real-time performance from my application and wondering if
I want to generate a random string of about 5 characters long. I can
This could well be a real stupid question, but I can't seem to sort
I'm having real trouble with the AddressBook and memory. I want it to return
I've had a fair search of some help, but I'm having a real load
I understand the troubles you can get into when you put a using declaration
I have real trouble understanding mod_rewrite, and got some help in creating a RewriteRule
I'm having a real trouble to get accents right, and I believe this may

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.