How to add a ScrollBar to a Stackpanel

后端 未结 5 1038
刺人心
刺人心 2020-12-08 18:12

In my WPF application, I have a Stackpanel containing several controls inside them. How can I add a Scrollbar to this stackpanel.

5条回答
  •  执念已碎
    2020-12-08 18:42

    It works like this:

    
            
    
            
    
    

    TextBox tb = new TextBox();
    tb.TextChanged += new TextChangedEventHandler(TextBox_TextChanged);
    stackPanel1.Children.Add(tb);
    

提交回复
热议问题