ToolStripItemImageScaling ToolStripItemImageScaling ToolStripItemImageScaling ToolStripItemImageScaling Enum

定義

ToolStripItem 上のイメージのサイズを、元のイメージの比率を維持しながら、ToolStrip に合わせて自動的に調節するかどうかを指定します。Specifies whether the size of the image on a ToolStripItem is automatically adjusted to fit on a ToolStrip while retaining the original image proportions.

public enum class ToolStripItemImageScaling
public enum ToolStripItemImageScaling
type ToolStripItemImageScaling = 
Public Enum ToolStripItemImageScaling
継承
ToolStripItemImageScalingToolStripItemImageScalingToolStripItemImageScalingToolStripItemImageScaling

フィールド

None None None None 0

ToolStripItem 上のイメージのサイズを、ToolStrip に合わせて自動的に調節しないよう指定します。Specifies that the size of the image on a ToolStripItem is not automatically adjusted to fit on a ToolStrip.

SizeToFit SizeToFit SizeToFit SizeToFit 1

ToolStripItem 上のイメージのサイズを、ToolStrip に合わせて自動的に調節するよう指定します。Specifies that the size of the image on a ToolStripItem is automatically adjusted to fit on a ToolStrip.

次のコード例に SizeToFit メンバーの適用、ToolStripButtonします。The following code example applies the SizeToFit member to a ToolStripButton.

    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

注釈

ImageImageAlignImageIndexImageKey、およびImageScalingプロパティは、画像処理のさまざまな側面に関連します。The Image, ImageAlign, ImageIndex, ImageKey, and ImageScaling properties pertain to various aspects of image handling. 内のイメージを使用して、ToolStrip直接これらのプロパティを設定するか、実行時専用の設定、コントロールImageListプロパティ。Use images in ToolStrip controls by setting these properties directly or by setting the run-time-only ImageList property.

イメージのスケーリングは両方のプロパティの相互作用によって決定されますToolStripToolStripItem、次のようにします。Image scaling is determined by the interaction of properties in both ToolStrip and ToolStripItem, as follows:

イメージのサイズを制御するには、使用、ImageScalingSizeプロパティ。To control the image size, use the ImageScalingSize property.

適用対象