Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Custom properties allow you to add your own properties to a Picturebox control that are not built-in. To utilize custom properties for the Picturebox control, follow these steps:

  1. Open your project in Visual Studio.
  2. Open the form that contains the Picturebox control.
  3. Select the Picturebox control.
  4. In the Properties window, click the lightning bolt icon to view the control's events.
  5. Click the ellipsis (...) button next to the (Custom) category to open the Custom Properties dialog.
  6. Click the Add button to add a new custom property.
  7. Enter a name for the property and select a data type, such as String or Integer.
  8. Click OK to add the property.
  9. Set the value of the custom property in the Properties window just like any other property.

Once you have added custom properties to the Picturebox control, you can use them in your code just like any other property. For example, you can set the custom property to store the path of an image file, and then use that property to load the image into the Picturebox control at runtime.