ToolStripItem.AutoToolTip Propiedad

Definición

Obtiene o establece un valor que indica si se utilizará la propiedad Text o la propiedad ToolTipText para la información sobre herramientas del ToolStripItem.

public:
 property bool AutoToolTip { bool get(); void set(bool value); };
public bool AutoToolTip { get; set; }
member this.AutoToolTip : bool with get, set
Public Property AutoToolTip As Boolean

Valor de propiedad

Boolean

true para utilizar la propiedad Text para la información sobre herramientas; de lo contrario, false. De manera predeterminada, es true.

Ejemplos

En el ejemplo de código siguiente se muestra cómo establecer , ImageImageScalingy ImageTransparentColor para .ToolStripItem Además, muestra cómo establecer y mostrar una información sobre herramientas personalizada para el elemento.

ToolStripButton^ imageButton;

void InitializeImageButtonWithToolTip()
{

    // Construct the button and set the image-related properties.
    imageButton = gcnew ToolStripButton;
    imageButton->Image = 
        gcnew Bitmap(Timer::typeid,"Timer.bmp");
    imageButton->ImageScaling = 
        ToolStripItemImageScaling::SizeToFit;

    // Set the background color of the image to be transparent.
    imageButton->ImageTransparentColor = 
        Color::FromArgb(0, 255, 0);

    // Show ToolTip text, set custom ToolTip text, and turn
    // off the automatic ToolTips.
    toolStrip1->ShowItemToolTips = true;
    imageButton->ToolTipText = "Click for the current time";
    imageButton->AutoToolTip = false;

    // Add the button to the ToolStrip.
    toolStrip1->Items->Add(imageButton);
}


//   internal:
internal ToolStripButton imageButton;

private void InitializeImageButtonWithToolTip()
{

    // Construct the button and set the image-related properties.
    imageButton = new ToolStripButton();
    imageButton.Image = new Bitmap(typeof(Timer), "Timer.bmp");
    imageButton.ImageScaling = ToolStripItemImageScaling.SizeToFit;

    // Set the background color of the image to be transparent.
    imageButton.ImageTransparentColor = Color.FromArgb(0, 255, 0);

    // Show ToolTip text, set custom ToolTip text, and turn
    // off the automatic ToolTips.
    toolStrip1.ShowItemToolTips = true;
    imageButton.ToolTipText = "Click for the current time";
    imageButton.AutoToolTip = false;

    // Add the button to the ToolStrip.
    toolStrip1.Items.Add(imageButton);
}
Friend WithEvents imageButton As ToolStripButton

Private Sub InitializeImageButtonWithToolTip()

    ' Construct the button and set the image-related properties.
    imageButton = New ToolStripButton()
    imageButton.Image = New Bitmap(GetType(Timer), "Timer.bmp")
    imageButton.ImageScaling = ToolStripItemImageScaling.SizeToFit

    ' Set the background color of the image to be transparent.
    imageButton.ImageTransparentColor = Color.FromArgb(0, 255, 0)

    ' Show ToolTip text, set custom ToolTip text, and turn
    ' off the automatic ToolTips.
    toolStrip1.ShowItemToolTips = True
    imageButton.ToolTipText = "Click for the current time"
    imageButton.AutoToolTip = False

    ' Add the button to the ToolStrip.
    toolStrip1.Items.Add(imageButton)

End Sub

Comentarios

ToolStripItem usa la Text propiedad como origen predeterminado para el ToolTip contenido. Establézcalo AutoToolTip false en para usarlo ToolTipText como origen para ToolTip el contenido.

Para usar esta propiedad, también debe establecer en ShowItemToolTips true.

Se aplica a