古詩詞大全網 - 成語解釋 - C#如何獲取窗體的TextBox的值

C#如何獲取窗體的TextBox的值

通過 TextBox 的屬性進行獲取;以下假設 TextBox 的 name 是 textBox

winform 是 Text 屬性, string str = textBox.Text; 就是窗體?TextBox 的值。

wpf 是 Content 屬性, string str = textBox.Content; 就是窗體?TextBox 的值。