Board index » delphi » using tag property

using tag property

To further my education...
The definition of the tag property suggests that it can be used in a
case statement.  I have been unsuccessful in implementing this
suggestion.  Can someone give me an example.  ( using tag property of a
dbedit ).

Thanks in advance.

Terry

 

Re:using tag property


Quote
"FTSoft" <fts...@computer.org> wrote in message

news:3958B1FB.C6CE317@computer.org...

Quote
> To further my education...
> The definition of the tag property suggests that it can be used in a
> case statement.  I have been unsuccessful in implementing this
> suggestion.  Can someone give me an example.  ( using tag property of a
> dbedit ).

> Thanks in advance.

> Terry

Here is a small example of using the TDBEdit OnChange event for several
TDBEdits:

procedure MyForm.EditChange(Sender: TObject);
begin
    case TDBEdit(Sender).Tag of
        1: Showmessage('TDBEdit #1 was changed.');
        2: Showmessage('TDBEdit #2 was changed.');
        ... as many tags as needed here...
    end;
end;

HTH
Woody

Re:using tag property


Quote
In article <3958B1FB.C6CE...@computer.org>, FTSoft wrote:
> The definition of the tag property suggests that it can be used in a
> case statement.  I have been unsuccessful in implementing this
> suggestion.  Can someone give me an example.  ( using tag property of a
> dbedit ).

Presumably you want to use it via an event handler. Try something like:

  case TDBEdit(Sender).Tag of
    1: do_something;
    2: do_something_else;
  else do_error;
  end;

 Mike Orriss (TeamB)
 (Unless stated otherwise, my replies relate to Delphi 4.03/5.00)
 (Unsolicited e-mail replies will most likely be ignored)

Other Threads