C
C
Chipu2019-05-28 18:18:33
WPF
Chipu, 2019-05-28 18:18:33

The TabControl does not change its size in the constructor, but it does when the click event fires. What is the problem?

Does not change the size in the constructor. What can be wrong?

public partial class PacientForm : Window
    {
        public PacientForm()
        {
            InitializeComponent();
            tabControl1.Width = this.Width;
        }
        private void bclick(object sender, RoutedEventArgs e)
        {
            tabControl1.Width = this.Width;
        }
    }

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Peter, 2019-05-28
@Chipu

the fact is that first the constructor is called by the level above, and then the size is set in InitializeComponent(); (which is a level higher, that is, the parent control)
It turns out that this.Width has not yet been set.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question