Mike Howard
Mike Howard

Reputation: 73

Changing tab captions of Tabbed Document Interface at run-time

I have a base form that all MDI child forms inherit from. The OnCreate makes a call to the notify the main form a new tab needs to be created. That tab's caption uses the MDIChild's caption.

When child window caption is changed at run-time, how can I capture or be notified so its corresponding tab can be updated with the new caption?

Looking for something like how the Main form's WindowMenu property works.

I have tried to capture the WM_MDISETMENU message in the main form, but no luck:

procedure TMainForm.WMMDISetMenu(var Msg: TWMDISetMenu); message WM_MDISETMENU;

I have researched high and low, but to no avail. Is there a real answer out there somewhere?

Upvotes: 1

Views: 226

Answers (1)

Rob Kennedy
Rob Kennedy

Reputation: 163287

Since you've subclassed the child-window class already, all you have to do is handle the wm_SetText message. Call the inherited handler, and then update the tab caption.

Upvotes: 3

Related Questions