Fill Buttons with LinearGradientBrush

Wizard for Windows Forms Forum

Posted 16 years ago by Lars Michel
Version: 3.0.0137

i like to fill the background of the buttons (back, next, cancel ...) with a LinearGradientBrush manually.

Here is my code:

Dim rect As Rectangle = _
   New Rectangle(0, 0, _
      Me.Wizard1.CancelButton.Width, _

Dim brush As LinearGradientBrush = _
   New LinearGradientBrush(rect, _
      Color.Yellow, Color.Red, _

Dim g As Graphics

g = Me.Wizard1.CancelButton.CreateGraphics

g.FillRectangle(brush, rect)

Unfortunately this code doesn't work.

Does the buttons support the function CreateGraphics or what could be the problem here?

Best regards

Lars Michel

Comments (1)

Posted 16 years ago by Actipro Software Support - Cleveland, OH, USA
Hi Lars,

The buttons in the Wizard are standard .NET WinForms buttons. So I doubt that would work.

Actipro Software Support

The latest build of this product (v24.1.0) was released 4 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.