LinearGradientBrush, too many arguments to public Sub New().

Hello

I am using thisLinearGradientBrush to chnage the gradient color of my ToolStripButton which is on ToolStrip control. I've the follwoing code

Dim xAsInteger = 20

Dim yAsInteger = 20

Dim hAsInteger = 100

Dim wAsInteger = 200

Dim myRectAsNew Rectangle(x, y, w, h)

Dim myLGBrushAsNew LinearGradientBrush(myRect, Color.Blue, Color.Aquamarine, 45.0F,True)


But I'm getting too many arguments to public Sub New().

Any help will be highly apprecieted.

Thanks
Khalid Mirza
KhalidJalil@Hotmail.Com

[1840 byte] By [KhalidMirza] at [2007-12-16]
# 1
I just tried your code and it works correctly. Can you post the exact error message you are getting, word for word?
DavidM.Kean at 2007-9-8 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 2
Thanks David.

It worked for me also after changing the event declaration. What I really want to accomplish is to change the color of a ToolStripButton (contained in a Toolstrip) with gradient color when I click the button. I dont know how? I can change the back color, but not the gradient.

Any idea?
Khalid

KhalidMirza at 2007-9-8 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 3

I tried the code that you used and it seems to work for me if I change the 4th argument from 45.0F to CSng(45).

Hope that helps.

KrisLa_MS at 2007-9-8 > top of Msdn Tech,Visual Basic,Visual Basic General...