Add a Gradient to the form!

Heres your chance to share your own tutorials with the community. Just post them on here. If your lucky they may even be posted on the main site.
7 posts Page 1 of 1
Contributors
User avatar
code it
VIP - Site Partner
VIP - Site Partner
Posts: 821
Joined: Sun Oct 10, 2010 3:02 pm

Add a Gradient to the form!
code it
Ok this is gonna be the tutorial! wahooo; wahooo;


Go to FORM1_PAINT

ADD THIS CODE ! :
Dim Rect As New Drawing.Rectangle(0, 0, Width, Height)
Dim Gradi As New Drawing2D.LinearGradientBrush(Rect, Color.Black, Color.White, 50, True)
e.Graphics.FillRectangle(Gradi, 0, 0, Width, Height)

THE BOLD :

Those are the colors for gradient,you can change them and your DONE!!

Also works for Panel_Paint ( I THINK)
EDIT: YES IT DOES! wahooo;
PLEASE +REP!!
Last edited by code it on Sat Mar 26, 2011 2:48 pm, edited 4 times in total.
GoodGuy17
Coding God
Coding God
Posts: 1610
Joined: Mon Sep 07, 2009 12:25 am

Re: Add a Gradient to the form!
GoodGuy17
Bold does not work in the
Code: Select all
 tags.

I seem to think you should've made a GDI tutorial, and put this as one of the codes inside. Would've made it more... valid.
User avatar
code it
VIP - Site Partner
VIP - Site Partner
Posts: 821
Joined: Sun Oct 10, 2010 3:02 pm

Re: Add a Gradient to the form!
code it
I fixed it a bit..
User avatar
tsuyoka
Member
Member
Posts: 40
Joined: Sat May 22, 2010 6:56 pm

Re: Add a Gradient to the form!
tsuyoka
Code: Select all
Tags
are there for a reason! Use them! btw nice tut.
User avatar
code it
VIP - Site Partner
VIP - Site Partner
Posts: 821
Joined: Sun Oct 10, 2010 3:02 pm

Re: Add a Gradient to the form!
code it
tsuyoka wrote:
Code: Select all
Tags
are there for a reason! Use them! btw nice tut.
I know but then the bold wont show :|
User avatar
Cheatmasterbw
Coding God
Coding God
Posts: 1506
Joined: Fri Jan 01, 2010 2:30 pm

You can probably do this:
Code: Select all
[code]Dim Rect As New Drawing.Rectangle(0, 0, Width, Height)
Dim Gradi As New Drawing2D.LinearGradientBrush(Rect, [First Color], [Second Color], 50, True)
e.Graphics.FillRectangle(Gradi, 0, 0, Width, Height)
[/code]
http://www.megaapps.tk/
User avatar
Jg99
VIP - Site Partner
VIP - Site Partner
Posts: 453
Joined: Sun Mar 20, 2011 5:04 am

Re: Add a Gradient to the form!
Jg99
cool tut
http://www.sctechusa.com SilverCloud Website
7 posts Page 1 of 1
Return to “Tutorials”