ButtonBase.ImageList プロパティ
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)

Dim instance As ButtonBase Dim value As ImageList value = instance.ImageList instance.ImageList = value
/** @property */ public ImageList get_ImageList () /** @property */ public void set_ImageList (ImageList value)
ImageList。既定値は null 参照 (Visual Basic では Nothing) です。

ImageList プロパティまたは ImageIndex プロパティが設定されている場合は、Image プロパティが既定値の null 参照 (Visual Basic では Nothing) に設定されます。
![]() |
---|
ImageList プロパティ値が null 参照 (Visual Basic では Nothing) に変更された場合、ImageIndex プロパティは既定値 -1 を返します。ただし、代入された ImageIndex 値は内部で保持され、この ImageList プロパティに別の ImageList が割り当てられたときに使用されます。ImageList プロパティに割り当てられた新しい ImageList の ImageList.ImageCollection.Count プロパティ値が、ImageIndex プロパティに代入されている値から 1 を引いた値以下の場合 (コレクションが 0 から始まるインデックス番号であるため)、ImageIndex プロパティ値は Count プロパティ値より 1 小さい値に調整されます。たとえば、3 つのイメージがある ImageList を持ち、ImageIndex プロパティが 2 に設定されているボタン コントロールがあるとします。このボタンに、イメージが 2 つしかない新しい ImageList を割り当てると、ImageIndex 値は 1 に変更されます。 |

派生クラス Button を使用して、ImageList プロパティと ImageIndex プロパティを設定するコード例を次に示します。このコードでは、ImageList が作成されており、そこに Image が 1 つ以上割り当てられている必要があります。また、C:\Graphics ディレクトリに MyBitMap.bmp という名前のビットマップ イメージが格納されている必要もあります。
Private Sub AddMyImage() ' Assign an image to the ImageList. ImageList1.Images.Add(Image.FromFile("C:\Graphics\MyBitmap.bmp")) ' Assign the ImageList to the button control. button1.ImageList = ImageList1 ' Select the image from the ImageList (using the ImageIndex property). button1.ImageIndex = 0 End Sub 'AddMyImage
private void AddMyImage() { // Assign an image to the ImageList. ImageList1.Images.Add(Image.FromFile("C:\\Graphics\\MyBitmap.bmp")); // Assign the ImageList to the button control. button1.ImageList = ImageList1; // Select the image from the ImageList (using the ImageIndex property). button1.ImageIndex = 0; }
private: void AddMyImage() { // Assign an image to the imageList. imageList1->Images->Add( Image::FromFile( "C:\\Graphics\\MyBitmap.bmp" ) ); // Assign the imageList to the button control. button1->ImageList = imageList1; // Select the image from the ImageList (using the ImageIndex property). button1->ImageIndex = 0; }
private void AddMyImage() { // Assign an image to the ImageList. imageList1.get_Images().Add(Image.FromFile( "C:\\Graphics\\MyBitmap.bmp")); // Assign the ImageList to the button control. button1.set_ImageList(imageList1); // Select the image from the ImageList (using the ImageIndex property). button1.set_ImageIndex(0); } //AddMyImage
private function AddMyImage() { // Assign an image to the ImageList. ImageList1 = new ImageList; ImageList1.Images.Add(Image.FromFile("C:\\Graphics\\MyBitmap.bmp")); // Assign the ImageList to the button control. button1.ImageList = ImageList1; // Select the image from the ImageList (using the ImageIndex property). button1.ImageIndex = 0; }

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からButtonBase.ImageList プロパティを検索する場合は、下記のリンクをクリックしてください。

- ButtonBase.ImageList プロパティのページへのリンク