Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Programming
»
General
»
(SOLVED) TToolButton question
Free Pascal
Website
Downloads
Wiki
Documentation
Bugtracker
Mailing List
Lazarus
Website
Downloads (Laz+FPC)
Packages (OPM)
FAQ
Wiki
Documentation (RTL/FCL/LCL)
Bugtracker
CCR Bugs
GIT
Mailing List
Other languages
Foundation
Website
Useful Wiki Links
Project Roadmap
Getting the Source
Screenshots
How to use the forum
Forum Rules
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
[SOLVED] GTK3 : Icons hav...
by
zeljko
[
Today
at 02:59:43 pm]
Any way to "embed" Window...
by
myisjwj
[
Today
at 02:50:41 pm]
could Ardour's YTK be use...
by
robert rozee
[
Today
at 02:43:31 pm]
Hello! Anything new?
by
marcov
[
Today
at 02:36:45 pm]
Problem with drawing orde...
by
VisualLab
[
Today
at 02:03:37 pm]
Debian releases a Gtk3 La...
by
dsiders
[
Today
at 12:57:13 pm]
mORMot again (HttpServer/...
by
ttomas
[
Today
at 12:45:49 pm]
Getting results from sql ...
by
Zvoni
[
Today
at 11:51:41 am]
Is it me or is there some...
by
Martin_fr
[
Today
at 11:48:04 am]
Exiting HeapTrace dump
by
jamie
[
Today
at 11:34:49 am]
CONCAT formula
by
Zvoni
[
Today
at 08:17:21 am]
emuloader: help to resurr...
by
arcadegamer
[March 15, 2026, 08:30:31 pm]
AutoSize TMemo.Height?
by
wp
[March 15, 2026, 05:55:05 pm]
Initialization & finaliza...
by
Martin_fr
[March 15, 2026, 05:24:36 pm]
Possible Enhancement to t...
by
jamie
[March 15, 2026, 04:10:38 pm]
lazarus 4.99 and missing ...
by
wp
[March 15, 2026, 03:11:43 pm]
Questions about TFuncSeri...
by
hedgehog
[March 15, 2026, 06:58:29 am]
CryptoLib4Pascal
by
Xor-el
[March 14, 2026, 06:17:32 pm]
Extended Module Player
by
Gigatron
[March 14, 2026, 05:32:06 pm]
[AGGPas] Difference betwe...
by
Roland57
[March 14, 2026, 04:36:02 pm]
declaring Array
by
Thaddy
[March 14, 2026, 01:24:11 pm]
TChart: Wrong default val...
by
wp
[March 14, 2026, 11:30:54 am]
Text Fill (Memo)
by
paweld
[March 14, 2026, 09:09:13 am]
Qt6/Wayland clipboard: pa...
by
AlexTP
[March 14, 2026, 08:56:58 am]
Pocketbase
by
PierceNg
[March 14, 2026, 06:29:04 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: (SOLVED) TToolButton question (Read 2629 times)
xinyiman
Hero Member
Posts: 2261
(SOLVED) TToolButton question
«
on:
December 14, 2011, 03:17:44 pm »
Hello guys, I create a TToolBar at run time by creating some TToolButton and run-time check all the steps @ MyProcedure
How do I know in
procedure TForm1.MyProcedure(Sender: TObject);
TCoolButton which I hold?
«
Last Edit: December 14, 2011, 04:49:22 pm by xinyiman
»
Logged
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1
ludob
Hero Member
Posts: 1173
Re: TToolButton question
«
Reply #1 on:
December 14, 2011, 03:59:08 pm »
(Sender as TControl).name
Edit: a more structured way of doing this is to assign a value to TControl.Tag when creating the control and then check (Sender as TControl).Tag. This avoids testing strings.
«
Last Edit: December 14, 2011, 04:13:09 pm by ludob
»
Logged
xinyiman
Hero Member
Posts: 2261
Re: TToolButton question
«
Reply #2 on:
December 14, 2011, 04:49:10 pm »
Thank you. is perfect
Logged
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Programming
»
General
»
(SOLVED) TToolButton question
TinyPortal
© 2005-2018