I’m trying to replace the so-called “Workspace Tabs” of Visual WebGui. This was basically a TabControl, which also had a “close tab” functionality, and it allowed for multiple “forms” to be hosted in individual tabs and, therefore, be available to the user at the same time. Something like an MDI form on WinForms.
So the MDI window of Wisej sounds like the prefect candidate for this replacement. As I discovered, a Wisej MDI window is just another plain window with its .IsMdiContainer property set to true. I can create Forms at run-time and add them to the parent MDI form by setting their .MdiParent property to the MdiContainer form. Then these child windows show up as tabs inside the MdiContainer. A great feature of this container is the last tab which contains “pictures” of all the other currently open tabs, and from which one can get a quick visual overview of the open tabs and select the desired one to activate (i.e. bring to the front to work with).
Now this “activate” point is that I miss: I can’t find a way to catch the event of activating a tab. Neither the “MdiChildActivate” or “TabIndexChanged” events of the MdiContainer fire.
As a general point, I find the form/window term very confusing. What I mean is “Project –> Add New Item –> Empty Window” gives me a new instance of the Form class. The confusion probably comes from my Visual Webgui background where a Form was more what in Wisej is a “page”. I suppose the WinForms equivalent is a “Form”, i.e. “Project –> Add New Item –> New Form”. But of course I may be the only one who is confused!
All the best,
first an answer to your question regarding the close button on MDI tabs:
You can’t handle the tabs in the tabbed mdi directly. They are wired to the relative mdi child form. The close button on the tab corresponds to the close button on the form, to remove it set form1.ControlBox = false – before setting form1.MdiParent.
For the problem of not showing the form icon in the MdiTabView I have logged WJ-7412.
… and, since we are still talking about MDI, can we add an image on each MDI tab ? Before or after its Text? I tried setting the Form.Icon or Form.IconSource properties but nothing showed up.
In fact, forgetting the MDI, I set the Form.ImageSource property of a window form to the path to a gif file, the Window title moved to the right to accommodate for the icon, but the icon didn’t show up.
I’ll address the questions individually:
And the last answer, related to the more important question is:
The close functionality is already included in the TabControl. You can enable/disable it for the individual tab setting the TabPage.ShowCloseButton property. And should be automatically there for the tabbed mdi. It can also be turned on/off in the theme. And I just noticed that now is not visible anymore. Logged as WJ-7404.
So you got 3 bugs with 1 post!