AdvancedHMI Software

General Category => Support Questions => Topic started by: Mvlawn on March 04, 2016, 10:30:57 AM

Title: Can an image or other object, be a form change button?
Post by: Mvlawn on March 04, 2016, 10:30:57 AM
I would like to use an image as a form change button. Is this possible?
Title: Re: Can an image or other object, be a form change button?
Post by: hektop on March 04, 2016, 11:15:36 AM
Hi Mvlawn,

Let me see if I got this correct. You want to add a background image to a BasicButton? If so just add the BasicButton to the advancedHMI form > Select the recently added BasicButton > Go to the properties tab and look for the BackgroundImage property > Select it and you will see a 3 doted button > Click on it > Select Local resource > Click on the Import button > look for the desired image > Click Open > Click OK. If needed change the BackColor property from the Properties tab from transparent to black, or the desired color.

If this is not what you want can you be a little more detailed?
Title: Re: Can an image or other object, be a form change button?
Post by: Archie on March 04, 2016, 11:33:41 AM
There is also another method that will allow you to use any control as a Form change button.

- From the All Windows Forms Toolbox group, add a PictureBox to your form
- Using the BackgroundImage or Image property, add a picture to the PictureBox
- At the top of the Properties window are some icons, select the lightening bolt
- Go to the Click item and double-click in the area to the right of it, this will take you back to the code for the Click event handler
- Enter this code (changing Form2 to the name of the form you want to open):
Code: [Select]
Form2.Show
Me.Hide

Nearly all control have a Click event. With this same technique, you can use any control as a form change button.
Title: Re: Can an image or other object, be a form change button?
Post by: Mvlawn on March 04, 2016, 01:11:09 PM
Awesome. Thanks!!!