|
59 | 59 | <format type="text/markdown"><![CDATA[
|
60 | 60 |
|
61 | 61 | ## Remarks
|
62 |
| - <xref:System.Windows.Forms.ImageList> is typically used by other controls, such as the <xref:System.Windows.Forms.ListView>, <xref:System.Windows.Forms.TreeView>, or <xref:System.Windows.Forms.ToolBar>. You can add bitmaps or icons to the <xref:System.Windows.Forms.ImageList>, and the other controls are able to use the images as they require. |
| 62 | + <xref:System.Windows.Forms.ImageList> is typically used by other controls, such as <xref:System.Windows.Forms.ListView>, <xref:System.Windows.Forms.TreeView>, or <xref:System.Windows.Forms.ToolBar>. You can add bitmaps or icons to the <xref:System.Windows.Forms.ImageList>, and the other controls are able to use the images as they require. |
63 | 63 |
|
64 |
| - <xref:System.Windows.Forms.ImageList> uses a handle to manage the list of images. The <xref:System.Windows.Forms.ImageList.Handle%2A> is not created until certain operations, such as getting the <xref:System.Windows.Forms.ImageList.Handle%2A> or calling <xref:System.Windows.Forms.ImageList.Draw%2A>, are performed on the image list. Performing other operations, such as setting the <xref:System.Windows.Forms.ImageList.ColorDepth%2A> or <xref:System.Windows.Forms.ImageList.ImageSize%2A> will cause the <xref:System.Windows.Forms.ImageList.Handle%2A> to be recreated. Therefore, you should perform these operations before you add images to the <xref:System.Windows.Forms.ImageList>. In addition, when you work with forms that will be localized, you should always add an <xref:System.Windows.Forms.ImageList> and images when the Language property of a form is set to Default. Changing the form's language before you add images will corrupt the application resource files. |
65 |
| - |
66 |
| - |
| 64 | + <xref:System.Windows.Forms.ImageList> uses a handle to manage the list of images. The <xref:System.Windows.Forms.ImageList.Handle%2A> is not created until certain operations, such as getting the <xref:System.Windows.Forms.ImageList.Handle%2A> or calling <xref:System.Windows.Forms.ImageList.Draw%2A>, are performed on the image list. Performing other operations, such as setting the <xref:System.Windows.Forms.ImageList.ColorDepth%2A> or <xref:System.Windows.Forms.ImageList.ImageSize%2A>, will cause the <xref:System.Windows.Forms.ImageList.Handle%2A> to be recreated. Therefore, you should perform these operations before you add images to the <xref:System.Windows.Forms.ImageList>. In addition, when you work with forms that will be localized, you should always add an <xref:System.Windows.Forms.ImageList> and images when the `Language` property of a form is set to `Default`. Changing the form's language before you add images will corrupt the application resource files. |
67 | 65 |
|
68 | 66 | ## Examples
|
69 | 67 | The following code example shows how to select, remove, and display images.
|
|
116 | 114 |
|
117 | 115 | |Item|Description|
|
118 | 116 | |----------|-----------------|
|
119 |
| -|<xref:System.Windows.Forms.ImageList.ColorDepth%2A>|In the .NET Framework version 1.0, the default is <xref:System.Windows.Forms.ColorDepth.Depth4Bit>. In the .NET Framework version 1.1 or later, the default is <xref:System.Windows.Forms.ColorDepth.Depth8Bit>.| |
| 117 | +|<xref:System.Windows.Forms.ImageList.ColorDepth%2A>|In .NET Framework and .NET (Core) versions through .NET 7, the default is <xref:System.Windows.Forms.ColorDepth.Depth8Bit>. In .NET 8 and later versions, the default is <xref:System.Windows.Forms.ColorDepth.Depth32Bit>.| |
120 | 118 | |<xref:System.Windows.Forms.ImageList.ImageSize%2A>|The default is a <xref:System.Drawing.Size> object with a height and width of 16 by 16.|
|
121 |
| -|<xref:System.Windows.Forms.ImageList.TransparentColor%2A>|The default value is <xref:System.Drawing.Color.Transparent%2A>.| |
122 |
| - |
123 |
| - |
| 119 | +|<xref:System.Windows.Forms.ImageList.TransparentColor%2A>|The default value is <xref:System.Drawing.Color.Transparent%2A>.| |
124 | 120 |
|
125 | 121 | ## Examples
|
126 | 122 | The following code example demonstrates constructing an <xref:System.Windows.Forms.ImageList.%23ctor%2A>, adding images to the <xref:System.Windows.Forms.ImageList.Images%2A> property, setting the <xref:System.Windows.Forms.ImageList.ImageSize%2A> property, and using the <xref:System.Windows.Forms.ImageList.Draw%2A> method. To run this example, place it in a form containing a button named `Button1`. The example assumes the existence of `FeatherTexture.bmp` and `Gone Fishing.bmp` at c:\Windows\\. Change the example accordingly if the bitmaps do not exist on your system, or exist at another location.
|
|
161 | 157 | <format type="text/markdown"><![CDATA[
|
162 | 158 |
|
163 | 159 | ## Remarks
|
164 |
| - The <xref:System.Windows.Forms.ImageList> constructor enables you to associate a <xref:System.Windows.Forms.ImageList> with any <xref:System.ComponentModel.Container> object. By associating the <xref:System.Windows.Forms.ImageList> like this, you hand over control of the lifetime of the <xref:System.Windows.Forms.ImageList> to the <xref:System.ComponentModel.Container>. This can be useful if you use a number of components in your application, and want to dispose of all of them simultaneously. For example, if you associate a <xref:System.Windows.Forms.ToolTip>, an <xref:System.Windows.Forms.ImageList>, and a <xref:System.Windows.Forms.Timer> with a <xref:System.ComponentModel.Container>, calling <xref:System.ComponentModel.Container.Dispose%2A> on the Container will force disposal of all of these components as well. |
| 160 | + The <xref:System.Windows.Forms.ImageList> constructor enables you to associate a <xref:System.Windows.Forms.ImageList> with any <xref:System.ComponentModel.Container> object. By associating the <xref:System.Windows.Forms.ImageList> like this, you hand over control of the lifetime of the <xref:System.Windows.Forms.ImageList> to the <xref:System.ComponentModel.Container>. This can be useful if you use a number of components in your application and want to dispose of all of them simultaneously. For example, if you associate a <xref:System.Windows.Forms.ToolTip>, an <xref:System.Windows.Forms.ImageList>, and a <xref:System.Windows.Forms.Timer> with a <xref:System.ComponentModel.Container>, calling <xref:System.ComponentModel.Container.Dispose%2A> on the Container will force disposal of all of these components as well. |
165 | 161 |
|
166 | 162 | ]]></format>
|
167 | 163 | </remarks>
|
|
199 | 195 | <ReturnType>System.Windows.Forms.ColorDepth</ReturnType>
|
200 | 196 | </ReturnValue>
|
201 | 197 | <Docs>
|
202 |
| - <summary>Gets the color depth of the image list.</summary> |
203 |
| - <value>The number of available colors for the image. In the .NET Framework version 1.0, the default is <see cref="F:System.Windows.Forms.ColorDepth.Depth4Bit" />. In the .NET Framework version 1.1 or later, the default is <see cref="F:System.Windows.Forms.ColorDepth.Depth8Bit" />.</value> |
| 198 | + <summary>Gets or sets the color depth of the image list.</summary> |
| 199 | + <value>The number of available colors for the image. In .NET Framework and .NET (Core) versions through .NET 7, the default is <see cref="F:System.Windows.Forms.ColorDepth.Depth8Bit" />. In .NET 8 and later versions, the default is <see cref="F:System.Windows.Forms.ColorDepth.Depth32Bit" />.</value> |
204 | 200 | <remarks>
|
205 | 201 | <format type="text/markdown"><![CDATA[
|
206 | 202 |
|
|
438 | 434 | <format type="text/markdown"><![CDATA[
|
439 | 435 |
|
440 | 436 | ## Remarks
|
441 |
| - This corresponds to a Win32 HIMAGELIST handle. The handle is not created until you need to use it. Getting the handle causes it to be created. |
| 437 | + This corresponds to a Win32 `HIMAGELIST` handle. The handle is not created until you need to use it. Getting the handle causes it to be created. |
442 | 438 |
|
443 | 439 | ]]></format>
|
444 | 440 | </remarks>
|
|
537 | 533 | <format type="text/markdown"><![CDATA[
|
538 | 534 |
|
539 | 535 | ## Remarks
|
540 |
| - If the image collection has not yet been created, it is created when you retrieve this property. |
541 |
| - |
542 |
| - |
| 536 | + If the image collection has not yet been created, it is created when you retrieve this property. |
543 | 537 |
|
544 | 538 | ## Examples
|
545 | 539 | The following code example demonstrates constructing an <xref:System.Windows.Forms.ImageList.%23ctor%2A>, adding images to the <xref:System.Windows.Forms.ImageList.Images%2A> property, setting the <xref:System.Windows.Forms.ImageList.ImageSize%2A> property, and using the <xref:System.Windows.Forms.ImageList.Draw%2A> method. To run this example, place it in a form containing a button named `Button1`. The example assumes the existence of `FeatherTexture.bmp` and `Gone Fishing.bmp` at c:\Windows\\. Change the example accordingly if the bitmaps do not exist on your system, or exist at another location.
|
|
594 | 588 |
|
595 | 589 | When you set the <xref:System.Windows.Forms.ImageList.ImageSize%2A> property to a new value, the <xref:System.Windows.Forms.ImageList.Handle%2A> for the image list is recreated.
|
596 | 590 |
|
597 |
| - Because setting the <xref:System.Windows.Forms.ImageList.ImageSize%2A> property causes the handle to be recreated, you should set <xref:System.Windows.Forms.ImageList.ImageSize%2A> prior to setting the <xref:System.Windows.Forms.ImageList.Images%2A> property. When the handle for the <xref:System.Windows.Forms.ImageList> has been created, setting the <xref:System.Windows.Forms.ImageList.ColorDepth%2A> or <xref:System.Windows.Forms.ImageList.ImageSize%2A> properties in code, after setting the <xref:System.Windows.Forms.ImageList.Images%2A> property, will cause the collection of images set for the <xref:System.Windows.Forms.ImageList.Images%2A> property to be deleted. |
598 |
| - |
599 |
| - |
| 591 | + Because setting the <xref:System.Windows.Forms.ImageList.ImageSize%2A> property causes the handle to be recreated, you should set <xref:System.Windows.Forms.ImageList.ImageSize%2A> prior to setting the <xref:System.Windows.Forms.ImageList.Images%2A> property. When the handle for the <xref:System.Windows.Forms.ImageList> has been created, setting the <xref:System.Windows.Forms.ImageList.ColorDepth%2A> or <xref:System.Windows.Forms.ImageList.ImageSize%2A> properties in code, after setting the <xref:System.Windows.Forms.ImageList.Images%2A> property, will cause the collection of images set for the <xref:System.Windows.Forms.ImageList.Images%2A> property to be deleted. |
600 | 592 |
|
601 | 593 | ## Examples
|
602 | 594 | The following code example demonstrates constructing an <xref:System.Windows.Forms.ImageList.%23ctor%2A>, adding images to the <xref:System.Windows.Forms.ImageList.Images%2A> property, setting the <xref:System.Windows.Forms.ImageList.ImageSize%2A> property, and using the <xref:System.Windows.Forms.ImageList.Draw%2A> method. To run this example, place it in a form containing a button named `Button1`. The example assumes the existence of `FeatherTexture.bmp` and `Gone Fishing.bmp` at c:\Windows\\. Change the example accordingly if the bitmaps do not exist on your system, or exist at another location.
|
|
656 | 648 | <ReturnType>System.Windows.Forms.ImageListStreamer</ReturnType>
|
657 | 649 | </ReturnValue>
|
658 | 650 | <Docs>
|
659 |
| - <summary>Gets the <see cref="T:System.Windows.Forms.ImageListStreamer" /> associated with this image list.</summary> |
| 651 | + <summary>Gets or sets the <see cref="T:System.Windows.Forms.ImageListStreamer" /> associated with this image list.</summary> |
660 | 652 | <value>
|
661 | 653 | <see langword="null" /> if the image list is empty; otherwise, a <see cref="T:System.Windows.Forms.ImageListStreamer" /> for this <see cref="T:System.Windows.Forms.ImageList" />.</value>
|
662 | 654 | <remarks>
|
|
709 | 701 | <format type="text/markdown"><![CDATA[
|
710 | 702 |
|
711 | 703 | ## Remarks
|
712 |
| - You can use this event to do special processing when the <xref:System.Windows.Forms.ImageList.Handle%2A> is recreated by actions such as changing the <xref:System.Windows.Forms.ImageList.ColorDepth%2A> or <xref:System.Windows.Forms.ImageList.ImageSize%2A>. Special processing may be required because setting the <xref:System.Windows.Forms.ImageList.ColorDepth%2A> or the <xref:System.Windows.Forms.ImageList.ImageSize%2A> property after setting the <xref:System.Windows.Forms.ImageList.Images%2A> property causes the handle to be recreated and the images to be discarded. |
713 |
| - |
714 |
| - |
| 704 | + You can use this event to do special processing when the <xref:System.Windows.Forms.ImageList.Handle%2A> is recreated by actions such as changing the <xref:System.Windows.Forms.ImageList.ColorDepth%2A> or <xref:System.Windows.Forms.ImageList.ImageSize%2A>. Special processing may be required because setting the <xref:System.Windows.Forms.ImageList.ColorDepth%2A> or the <xref:System.Windows.Forms.ImageList.ImageSize%2A> property after setting the <xref:System.Windows.Forms.ImageList.Images%2A> property causes the handle to be recreated and the images to be discarded. |
715 | 705 |
|
716 | 706 | ## Examples
|
717 | 707 | The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.ImageList.RecreateHandle> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>.
|
|
0 commit comments