View Single Post
  #1   Spotlight this post!  
Unread 12-08-2004, 11:46
gomez6760 gomez6760 is offline
Registered User
no team
 
Join Date: Aug 2004
Location: canada
Posts: 1
gomez6760 has a little shameless behaviour in the past
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