disabling a button

can someone tell me how to disable or enable a button depending on the name of the button that I have stored in my database but without doing if’s in my procedure. What I want is the following:

Example I have 10 buttons in a form. The name of my buttons are stored in my database. But when my database sends back my result (example only 4 names) I cannot put the name of the button because delphi does not know that that is an object, it says that it is a string which is right because you store the name of the button as a string in your database.

I do not want to do a loop an 10 buttons and do if name is equal to btn.name
I would like to do a proedure only with the results

Any suggestions ? Thank you

I probably should point you to this sticky. I’m afraid that Chief Delphi is a web site of a FIRST Robotics team sponsored by Delphi, not a site covering Delphi programming.

There are a few folks here who may know Delphi programming, but your odds would probably be better at a Delphi programming forum.

Thanks for stopping by, either way! (Like robots? We’ve got plenty.)

–Billfred, aka “I am not a moderator, but I am JVN.”

(sorry, forum in-joke. couldn’t resist)