Reader Level:
ARTICLE

Circular Form in VB.NET

On November 10, 2012 Articles | Visual Basic .NET
This piece of code changes the looks of a normal VB form. It executes two API calls and changes the shape of the rectangular form to a Circular form.
  • 0
  • 0
  • 4438
Download Files:
 

Description:

This piece of code changes the looks of a normal VB form. It executes two API calls and changes the shape of the rectangular form to a Circular form. This circular form can be used as a splash form where user gets a feel of the good looks of the software. You can modify the code to use it for various shapes and sizes. You can also restrict the user from using the ctrl+ spacebar to exit by using the borderstyle property. This code is a demonstration of the following two APIs, which are used in VB6.

Procedure:

On running this code a circular form appears. By right clicking on it you can exit the application.

API Description.

'The CreateEllipticRgn function creates an elliptical region
Public Shared Function <DllImport("gdi32")> _
CreateEllipticRgn(ByVal X1 As Integer, _
ByVal Y1 As Integer, _
ByVal X2 As Integer, _
ByVal Y2 As Integer) As Integer
End
Function
'The SetWindowRgn function sets the window region of a window. The window 'region determines the area within the window where the system permits drawing. 'The system does not display any portion of a window that lies outside of the 'window region
Public Shared Function <DllImport("user32")> _
SetWindowRgn(ByVal hWnd As Integer, _
ByVal hRgn As Integer, _
ByVal bRedraw As Integer) As Integer
End
Function

Vishal Kulkarni

Vishal Kulkarni presently working with E-Forum systems Pvt. Ltd. in Nagpur, India. He is working as a software developer. HisĀ fields of expertise are VB 6.0, VB.NET, ASP, ASP.NET, COM/DCOM, XML, XSL, ...

  • 333rank
  • 184K readers
COMMENT USING

Trending up