Is there an analog QStackedWidget (Qt) in C # (.Net)?

  • 2
    And what does this QStackedWidget look like? Can attach a screenshot? - Dmitry D.
  • If I correctly understood what a QStackedWidget then there is no such Wpf in Wpf . - user227049

1 answer 1

Instead:

 addWidget(new QLabel("Page 1", this)); addWidget(new QLabel("Page 2", this)); addWidget(new QLabel("Page 3", this)); 

You can use "Notebook" tabs, they are also TabItem's:

 ListBox notesList = new ListBox(); notesList.Items.Add("Элемент контента 1"); notesList.Items.Add("Элемент контента 2"); notesList.Items.Add("Элемент контента 3"); TabControl products = new TabControl(); products.Items.Add(new TabItem { Header = new TextBlock { Text = "Page 1" }, Content = notesList}); products.Items.Add(new TabItem { Header = new TextBlock { Text = "Page 2" }, Content = notesList}); products.Items.Add(new TabItem { Header = new TextBlock { Text = "Page 3" }, Content = notesList}); products.Alignment = TabAlignment.Right; 

If you want to learn more, a good tutorial: http://metanit.com/sharp/wpf

Try it, here is a slightly different approach. Identical functionality, alas, no.

  • Qt has QTabWidget - the equivalent of TabControl . I think the answer can be complemented by how to achieve the desired behavior. - user227049
  • Yes, sorry for everything to work you need to add. TabControl products = new TabControl (); ... products.Alignment = TabAlignment.Right; And you will be happy. Similarly, you can set a fixed length of the buttons, twist them, etc. Appearance and other useful properties will help you here. - Nikita Fedorov