Friday, April 4, 2014

EASIEST WAY TO BUILD NON-RECTANGULAR FORM IN .NET

Hi guys ! today i came up with new post named ” EASIEST WAY TO BUILDNON-RECTANGULAR FORM IN .NET ” . While browsing web I have found many newcomer programmers who are confused in this little issue . Most of the sites are Providing Harder ways to do so . Here i came up with easiest way . I’ll show how to build a elliptical/circular/any non-rectangular form with just 2 lines of code . Lets start :


I’ll choose VB.NET .


1) Open sharpdevelop / Visual studio


2) Select New project


3) Go to Visual Basic


4) Select windows Forms application


5) Give any name


6) Hit enter


7) Now The Project form will be displayed


8) Go to properties and select Form “backcolor” ( Red , Black , Blue)


9) Go to “form-border-style” and Change it to None


10) Go to last of properties list and select ” transparency ” key same as Your form’s backcolor


11) Now Your Form will be completely transparent


12) Change the form size as You like


13) Insert the Timer object to the form


14) Now Its the coding Time. Double click the timer object to navigate to code window


15) In coding window Locate the Function which starts with private sub timer1_tick(….)


16) Inside this function just write ,


dim a = creategraphics()


To create Elliptical window ,add


a.fillellipse(Brushes.anycolor,x-axis,y-axis,width,height)


eg: a.fillellipse(brushes.red,200,200,80,60) to the next line .


17) Hit f5 , or press compile button(like play button)


18) Now You’ll see beautiful elliptical window at 200,200 position


if you want to make Pie like windows,
add
a.fillPie(Pens.color, x,y,width,height,start-angle,end-angle)
after dim a=creategraphics()


19) Its so simple like ABC , isn’t it .


In short just write
dim a=creategraphics()
a.FillEllipse(Brushes.DeepPink, 80, 100, 200, 150) inside timer event .


It’ll make beautiful elliptical Pink window at 100,100 position .


View Photo as Demo i’ve built . To add Other objects like close button You’ve to Note the position of drawing .


Thats for Now . Thanks for visiting . Good Bye .


+ How-to-make-non-rectangular-form
+How-to-make-circular-form
+Ho-to-make-elliptical form




[caption id="" align="aligncenter" width="261"] Demo[/caption]

0 comments:

Post a Comment