Re: Set the CheckBox.Checked without the OnClick being called
- From: "Dunny" <paul.dunn4@xxxxxxxxxxxx>
- Date: Mon, 11 Jun 2007 16:03:23 GMT
In news:1181570444.150663.62240@xxxxxxxxxxxxxxxxxxxxxxxxxxxx,
alanglloyd@xxxxxxx <alanglloyd@xxxxxxx> typed:
Values should NEVER be allocated to Tag in the IDE, ONLY in code. With
appropriate comments if necessary.
Oh, I don't know - I use the Tag property with menus. Set the tag of each
TMenuItem in ascending order, and then use one procedure to handle all
menuitemclick() events, ie:
Procedure TForm1.MenuItemClick(Sender: TObject);
Begin
Case (Sender As TComponent).Tag of
0: // New File
1: // Open File
2: // Save File
End;
End;
Etc etc.
I know you lot will probably find that to be very much an inelegant solution
(and possibly bad form to boot), but I really like having all my menu
handlers in one proc, rather than tens of small ones. It's also useful in
that I can set the Tag property of other controls and call that procedure if
I want it to replicate a menu function when an event occurs.
The drawback, of course, is that I have to look up which tag value goes with
which menu item/control, and that the tag is then unavailable if I want it
elsewhere.
D.
.
- Follow-Ups:
- Re: Set the CheckBox.Checked without the OnClick being called
- From: alanglloyd@xxxxxxx
- Re: Set the CheckBox.Checked without the OnClick being called
- From: Fons
- Re: Set the CheckBox.Checked without the OnClick being called
- From: Rob Kennedy
- Re: Set the CheckBox.Checked without the OnClick being called
- References:
- Set the CheckBox.Checked without the OnClick being called
- From: Fons
- Re: Set the CheckBox.Checked without the OnClick being called
- From: John Dough
- Re: Set the CheckBox.Checked without the OnClick being called
- From: Fons
- Re: Set the CheckBox.Checked without the OnClick being called
- From: John Dough
- Re: Set the CheckBox.Checked without the OnClick being called
- From: Fons
- Re: Set the CheckBox.Checked without the OnClick being called
- From: John Dough
- Re: Set the CheckBox.Checked without the OnClick being called
- From: Rob Kennedy
- Re: Set the CheckBox.Checked without the OnClick being called
- From: Jamie
- Re: Set the CheckBox.Checked without the OnClick being called
- From: Maarten Wiltink
- Re: Set the CheckBox.Checked without the OnClick being called
- From: alanglloyd@xxxxxxx
- Set the CheckBox.Checked without the OnClick being called
- Prev by Date: Re: Editing XML
- Next by Date: Re: Set the CheckBox.Checked without the OnClick being called
- Previous by thread: Re: Set the CheckBox.Checked without the OnClick being called
- Next by thread: Re: Set the CheckBox.Checked without the OnClick being called
- Index(es):
Relevant Pages
|