ToolTipsFactory

Object Model - Additional Properties - BackgroundGradientMode

Gets or sets a value that specifies the orientation of the linear gradient used to paint the tooltip background.

[Visual Basic]
Public Property BackgroundGradientMode As LinearGradientMode
[C#]
public LinearGradientMode BackgroundGradientMode {get; set;}

Property Value

Any value of the Drawing2D.LinearGradientMode-enumeration. Default value is LinearGradientMode.ForwardDiagonal.

Overridable

Layout-file

Property of
AnimationTT ImageTT SingleLineTT MultiLineTT

Description

This value defines the orientation of the linear gradient used to paint the tooltip background. It is only significant for layouts where Background=LinearGradient. 

To be precise, this value defines the orientation of the axis along which the linear gradient is painted. The four possible values are listed in the following table together with a sample to illustrate it's impact on the layout: 

 

BackgroundGradient settings Result
Specifies a gradient from left to right.
Specifies a gradient from top to bottom.
Specifies a gradient from upper left to lower right.
Specifies a gradient from upper right to lower left.

 

If specified at the component-level for a tooltip component (i.e. by defining the BackgroundGradientMode directly for the component), the assigned value will become the default BackgroundGradientMode for the tooltips of all controls on the same form:

'Assign a new linear gradient mode to the tooltip component

Me.MultiLine.GetMultiLineToolTip(Panel1).BackgroundGradientMode = LinearGradientMode.Vertical

This default BackgroundGradientMode can be overridden for each control through the Override-property provided to all controls on the same form by the tooltip component (see "The Override-Property").

If the override-value for the BackgroundGradientMode has to be set or changed at runtime for the tooltip of a specific control, code like the following is needed:

'Assign a new linear gradient mode to the override-object for Panel1

Me.MultiLine.GetMultiLineToolTip(Panel1).Override _

.BackgroundOverride.BackgroundGradientMode = LinearGradientMode.Vertical

Example 1

This statements define a linear gradient background at the component level. The individual colors of the BackgroundGradientColors-property are changed and a new BackgroundGradientMode is defined:

'define a linear gradient background for the tooltips

'provided by the component (MultiLine).

Me.MultiLine.Background = BackgroundStyle.LinearGradient

Me.MultiLine.BackgroundGradientMode = LinearGradientMode.Horizontal

'assign the start-color...

Me.MultiLine.BackgroundGradientColors(0) = Color.OrangeRed 

'...and the end-color for the gradient.

Me.MultiLine.BackgroundGradientColors(1) = Color.Blue

'Set a high gradient frequency to get a nicely striped border

Me.MultiLine.BackgroundGradientFrequency = 30