Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2009-11

Catching TForm title change

5 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

zeljko

Hi,
Is there any way to catch when some form changed it's title text ? I want to catch such changes inside main form.
Is it possible via LCL ?

tnx.

zeljko

Reply by email

Hans-Peter Diettrich
to zeljko
Is there any way to catch when some form changed it's title text ? I want to catch such changes inside main form. Is it possible via LCL ?

You can override RealSetText in your forms, and do there whatever is required. From there you can notify your main form directly, or you can trigger a new OnCaptionChanged event, for which your main form can provide an event handler.

DoDi

Reply by email

zeljko
to Paul Ishenin
Paul Ishenin wrote 7 lines
zeljko wrote: > Hi, > Is there any way to catch when some form changed it's title text ? > I want to catch such changes inside main form. > Is it possible via LCL ? you can add a message handler CM_TEXTCHANGED for your form.

tnx, but maybe I've asked it wrong (or you misunderstood) : I want to catch when some form (except application main form) changes title (non modal forms) inside main form handler.
So, when my Form2 changes title MainForm should know about it. If I have to add message handler to each of my forms, then it will take some amount of time .... that's the reason why I'm asking this - catch title change without adding any handler into forms, except main form.

zeljko

Reply by email

zeljko
to Hans-Peter Diettrich: You can override RealSetText in your forms, and do there whatever is required. From there…
Hans-Peter Diettrich wrote 9 lines
zeljko schrieb: > Is there any way to catch when some form changed it's title text ? > I want to catch such changes inside main form. > Is it possible via LCL ? You can override RealSetText in your forms, and do there whatever is required. From there you can notify your main form directly, or you can trigger a new OnCaptionChanged event, for which your main form can provide an event handler.

As I mentioned in my previous posts:
I don't want to touch forms code, only main form code can be touched.So it seem that such thing isn't possible in lcl.

zeljko

Reply by email