GrowButton

Giuseppe Zolli

GrowButton


GrowButton is a particular object that could be useful in much more situations that you beleive. It is a simple square (called button), that can display just a color or even an image. When the mouse goes over it, the button grows, becoming bigger and showing in details the image that you setted to it. You could use this object, for example, in all that cases where you don't want to have static boxes displaying an image, or where you don't have much space to collect big image boxes. Or, simply, when you just want to have a cool object that makes your application nicer. To use GrowButton you have to:

  1. Use SetDimensions(Size minSize, Size maxSize) to set a custom min size (the size that the button normally has) and a custom max size (the size that the button reached when it grows). Note that the default dimensions are (50, 50) for min and (100, 100) for max.
  2. Use SetImage(Image img) to set a custom background image. The format and the dimensions of the image are not a problem, if it is a right image, because the button automatically stretches the image you set. Note that the button has a default image.
  3. Use RemoveImage() if you want the button hasn't to display an image, but only the background color.
  4. Use SetBackColor(Color color) to set a custom background color. Note that the default background color is Cyan.
  5. You can catch one of the events raised by the button. The available events are: MouseOnButton and MouseOutButton. In this way, you can do something else when the mouse goes on the button and when leaves it.

END OF GUIDE



Related

Home: Home

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.