ToolTipsFactory

Object Model - Common Properties - Border

Gets or sets a value which defines the border-type to be used for the tooltip.

[Visual Basic]
Public Property Border As ToolTipsFactory.Enums.BorderStyle
[C#]
public ToolTipsFactory.Enums.BorderStyle Border {get; set;}

Property Value

A value from the ToolTipsFactory.Enums.BorderStyle enumeration. 

Overridable

Layout-file

Description

This property defines the kind of border to be drawn around the tooltip. The following border-styles are available: 
BorderStyle Description Example Rendering properties
None No border will be drawn.  BorderWidth
Normal The tooltip will be painted with a solid color border. The color used for this border-style is the value assigned to the property BorderColor. BorderWidth

BorderColor

LinearGradient

The tooltip border will be painted with a linear color gradient. The range of colors to be used for the gradient are specified in the BorderGradientColors-property. BorderWidth

BorderGradientColors

BorderGradientFocus

BorderGradientFrequency

BorderGradientMode

BorderGradientShape

Texture...

(There are 12 texture-related border-styles. See BorderTexture for more details)

The tooltip border will be painted with the texture assigned to the BorderTexture-property. BorderWidth

BorderTexture

Hatch A hatched border will be painted using the hatch-pattern assigned to the BorderHatchStyle-property. The foreground color used to draw the hatch-pattern is the color assigned to the BorderHatchColor-property, while the background color is taken from the BorderColor-property. BorderWidth

BorderColor

BorderHatchColor

BorderHatchStyle

Table 1


The Border-property only defines what kind of border should be applied to the tooltip. The details on how the selected BorderStyle has to be rendered, are specified by various other properties of the tooltip component. Table 1 shows this rendering properties for each border-style. Only the values assigned to this properties will affect the corresponding BorderStyle.

The only property that is significant for all border-styles is BorderWidth. A BorderWidth set to zero (0) is equivalent to Border=None. Therefore, if a border should be drawn it is necessary to select the desired BorderStyle and to specify a BorderWidth > 0.

If Border is set to None at design-time or at run-time, the BorderWidth-property will be reset to 0.

If specified at the component-level for a tooltip component (i.e. by assigning the value directly to the component), the assigned value will become the default BorderStyle for the tooltips of all controls on the same form. This default Border 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").

Please note: If the Border-style is to be overridden in code (as shown in Example 2),  a different enumeration then BorderStyle has to be used. The BorderStyleOverride-enumeration is equivalent to the BorderStyle-enum, but it provides one more value (OverrideOff), which is used to reset the border-override.

Example 1

This statement defines a default Border for all controls on the same form as the tooltip component:

'set the default Border to LinearGradient...

Me.MultiLine.Border = BorderStyle.LinearGradient

Me.MultiLine.BorderWidth = 5  'make the border 5 pixel wide

Me.MultiLine.BorderGradientColors(0) = Color.Red    'gradient start-color

Me.MultiLine.BorderGradientColors(1) = Color.Yellow 'gradient end-color

Example 2

How to override the default Border-style (or any other overridable property) through the various designers and editors in Visual Studio is extensively discussed in "The Override-Property". If the override-value for the Border-style has to be set or changed at runtime for the tooltip of a specific control, the following code is needed:

'This changes the border-style for the tooltip of Panel1

'to "Texture"...

Me.MultiLine.GetMultiLineToolTip(Panel1).Override.BorderOverride.Border _

 = BorderStyleOverride.TextureStretch

'...and loads the desired texture from an image-file.

Me.MultiLine.GetMultiLineToolTip(Panel1).Override.BorderOverride _ .BorderTexture = Image.FromFile("C:\Temp\water.jpg")