我想在消息框中显示文本框文本,不断收到错误。
MessageBox.Show(textBox1.text + "Saved As PDF");
,错误是
Error 1 'System.Windows.Forms.TextBox' does not contain a definition for
'text' and no extension method 'text' accepting a first argument of type
'System.Windows.Forms.TextBox' could be found (are you missing a using
directive or an assembly reference?)
R:\Engineer\Russell Saari\CONFIGURATOR MODELS\MLD028 Userform (C# Coding)\WindowsFormsApplication2\MLD028D Actuator Form Complete.cs 118 38 WindowsFormsApplication
答案 0 :(得分:9)
属性通常以大写字母开头。
尝试
MessageBox.Show(textBox1.Text + "Saved As PDF");
(请注意T
中的.Text
是大写的)
答案 1 :(得分:4)
你没有说出错误是什么,但是要开始,让我们编译你的代码。 Text
应该大写。
MessageBox.Show(textBox1.Text + "Saved As PDF");