Fill Buttons with LinearGradientBrush

Wizard for Windows Forms Forum

Posted 16 years ago by Lars Michel
Version: 3.0.0137
Avatar
Hello,

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, _
      Me.Wizard1.CancelButton.Height)

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

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
Avatar
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.1) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.