ToolStripItem.ToolTipText Özellik

Tanım

Denetim için olarak ToolTip görünen metni alır veya ayarlar.

C#
public string ToolTipText { get; set; }

Özellik Değeri

String

Araç İpucu metnini temsil eden bir dize.

Örnekler

Aşağıdaki kod örneğinde, için , ve değerlerinin Imagenasıl ayarlanacağı gösterilmektedirToolStripItem.ImageTransparentColor ImageScaling Buna ek olarak, öğe için özel bir Araç İpucu ayarlamayı ve göstermeyi gösterir.

C#
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);
}

Açıklamalar

ToolTipText yalnızca ShowItemToolTips olarak ayarlandığında trueçalışır. olarak ayarlanırsa AutoToolTip true, Text öğenin özelliği olarak ToolTipTextkullanılır.

Şunlara uygulanır

Ürün Sürümler
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8
Windows Desktop 3.0, 3.1, 5, 6, 7