R
R
rundll322021-08-02 17:05:29
C++ / C#
rundll32, 2021-08-02 17:05:29

Different View in WinForms?

In mobile applications, the program can have different "screens", while they are all in the same form. The question is how to do something similar in WinForms. But the implementation raises a lot of questions and difficulties.
For example, MDI is clearly not right, because the forms should not be independent, but only one active should be displayed. If you show modal windows (Form.ShowDialog), then you need to process their closing by the user, and it doesn’t look very good. Well, form1.Hide() form2.Show() is like a crutch for me, and, again, you need to provide for possible closing forms, adjust their size, etc.
TabControl would come closest to me, only the transition to different tabs should not depend on clicking on them by the user.
Hope my question can be understood

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Voland69, 2021-08-02
@Voland69

TabControl with a hidden title and switching tabs from the code on the necessary events.

F
Foggy Finder, 2021-08-02
@FoggyFinder

Use a normal UserControl as a "page" (screens), and to display them select the appropriate panel. In the simplest case, this can be a regular Panel

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question