What is TLabel.FocusControl? lazarus / 31-LCL ---------------------------------------------------------------------- Avishai · 2011-11-11 10:04 TLabel has property FocusControl, but it does not seem to be used for anything yet.  Does anybody know what the plans are for this property? ---------------------------------------------------------------------- zeljko · 2011-11-12 16:00 It focuses it's FocusControl property (if assigned) eg: when you assign eg MyEdit (TEdit) to FocusControl and you click onto TLabel it must focus MyEdit. see TCustomLabel implementation for details. ---------------------------------------------------------------------- Avishai · 2011-11-12 16:41 I think that may be planned for it the future, but not yet implemented.  For now, you must assign an OnClick event  and tell it to SetFocus to the FocusControl, and if you have to do that, you can Focus any Control that can be Focused without a FocusControl property.  And TLabel seems to be the only Control that has a FocusControl property.  Either that or I am missing something. ---------------------------------------------------------------------- zeljko · 2011-11-15 07:31 hm..then something is wrong in TCustomLabel implementation since there's WMActivate handler which calls setFocus for FocusControl property. Please open an issue about this. ---------------------------------------------------------------------- Avishai · 2011-11-15 07:48 I checked Delphi 6 and it does the same like Lazarus.  Both do nothing.  It looks like a unfinished idea.  Maybe unfinished because it was a bad idea.  Personally I do not see a need for it.  My question was curiosity.  I looked in CustomaLabel.inc and found FocusControl in the "ToDo List". ---------------------------------------------------------------------- Ocye · 2011-11-16 12:27 Quote from: Avishai on November 15, 2011, 08:48:48 amPersonally I do not see a need for it.If you specify a hotkey (e.g. &Label) the FocusControl can be used to activate the appropriate control. It makes sense for TLabel/TEdit combinations, for instance, allowing the user to access all controls by keyboard. And: It works well. ---------------------------------------------------------------------- Avishai · 2011-11-16 12:41 Mr. Ocye, you are right.  I did not know about this.  Thank you for pointing to it.  Now I know, I will use it.  I wonder why in CustomaLabel.inc FocusControl in the "ToDo List".  It look like it is already done   I am glad I asked.