|
-
Apr 18th, 2017, 02:15 PM
#31
Re: Errors when trying to replicate using community 2015
 Originally Posted by jcarpenter8504
As stated in the Title, I am running this in Community 2015. My question is can this be done in 2015, and if it can, what did I do wrong?
Code:
' Render container background gradient: Overload resolution failed because no accessible 'New' accepts this number of arguments.
Protected Overrides Sub OnRenderToolStripBackground(e As ToolStripRenderEventArgs)
MyBase.OnRenderToolStripBackground(e)
Dim b As New Drawing2D.LinearGradientBrush(e.AffectedBounds, clrVerBG_White, clrVerBG_GrayBlue,
Drawing2D.LinearGradientMode.Vertical)
Dim shadow As New Drawing.SolidBrush(clrVerBG_Shadow)
Dim rect As New Rectangle(0, e.ToolStrip.Height - 2, e.ToolStrip.Width - 1) ' Error on this line
e.Graphics.FillRectangle(b, e.AffectedBounds)
e.Graphics.FillRectangle(shadow, rect)
End Sub
Code:
' OnRenderImageMargin: Error on last FillRectangle. says it failed because Value of type Pen cannot be converted to Brush
e.Graphics.FillRectangle(SubmenuBGbrush, rect3)
e.Graphics.FillRectangle(b, e.AffectedBounds)
e.Graphics.FillRectangle(DarkLine, rect)
e.Graphics.FillRectangle(WhiteLine, rect2)
e.Graphics.FillRectangle(borderPen, rect4) ' Error on this line
Yes it certainly can be done in VS 2015 Community edition.
To answer the "new" error on the rectangle, you're missing an input position parameter, you specify either the Top or the Left (with a 0 (zero)) but not the other (which would probably be a 0 again), so it should be like this: Dim rect As New Rectangle(0, 0, e.ToolStrip.Height - 2, e.ToolStrip.Width - 1)
To answer the FillRectangle error, it says you're passing it a Pen object when it requires a Brush object, somewhere you're creating a Pen named borderPen then passing "borderPen" into the e.Graphics.FillRectangle(borderPen, rect4), what you should be doing is creating a borderBrush As New Brush().... instead and use that.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|