How to link tabs of components ( TabSet
, TabControl
) with a child window of an MDI application? So, when creating a new window to create a tab with the same title, when you click on a tab, a corresponding window appears and when the window is closed, the corresponding tab closes?
|
1 answer
- Get a list matching tab indexes with window instances.
- Get a method that will be responsible for: creating a window, creating a tab, entering them into this list.
- Create windows using this method.
- On the
onChange
eventonChange
check the index of the current tab, look at the list and pull out the corresponding window. - Closing windows is harder. Because the number of tabs will vary, and you will have to go over the list and decrement tab indexes that exceed the closed tab index.
Then you will realize that you are not satisfied with this, and you will overwrite everything already beautifully in the form of several classes that implement a small window manager)
Well, in general, TabSet is not the most convenient component for this task, it is better to take something more interesting (with appearance settings, icons, a cross). Yes, and VCLevsky MDI is fraught with many surprises.
- How to call the desired window if the MDIChildren property is constantly changing. Using which property can I call the desired window? - Seg_Dock
- send him a WM_MDIACTIVATE message - Nofate ♦
|