• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 702
  • Last Modified:

vfp9 command buttons

Hi Experts

I have more than 20 command buttons on my form.
I would like to find the name of command button clicked so that I can set the backcolor of that button different to the rest on the form.
or
is there different way of showing different backcolor of the button just clicked to the rest of the buttons on my form.

Thanks
0
b001
Asked:
b001
1 Solution
 
CaptainCyrilFounder, Software Engineer, Data ScientistCommented:
If you based it on a class then in the Click Event:

This.BackColor = RGB(128,0,0)

You will also have to reset the colors of the rest in a loop.
0
 
pcelbaCommented:
Maybe the command buttons are not the right control in your case...
If you would use OptionGroup then you may simply see the last option clicked.
But it allows to have just one option clicked...

So you could use graphical checkboxes (checkbox with Style = 1) which directly show the button status.

If you persist on command buttons then the answer from Captain is OK.
0

Featured Post

[Webinar] Kill tickets & tabs using PowerShell

Are you tired of cycling through the same browser tabs everyday to close the same repetitive tickets? In this webinar JumpCloud will show how you can leverage RESTful APIs to build your own PowerShell modules to kill tickets & tabs using the PowerShell command Invoke-RestMethod.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now