如何在form1.cs文件的另一個自定義類中引用TextBox
對象(如textBox1)?文本框對象參考
在myclass
中,我寫了textBox1
,但intelliSense沒有向我建議。將私人變爲公衆並不能解決問題。
這裏是Form1.cs的
namespace Calculator {
public partial class Form1: Form {
public Form1() {
// InitializeComponent();
}
class myclass {
// What can I do to make texbox1 show up in intelliSense here?
// textBox1
}
public System.Windows.Forms.TextBox textBox1;
}
}
請讓你的問題更清楚,更易於理解,以便我們能夠回答。 – 2013-03-15 00:13:11
請發佈一些代碼。 – AbZy 2013-03-15 00:13:53
順便說一句,做羅伯特哈維所說的首選方式是向我們展示一些代碼。 – dasblinkenlight 2013-03-15 00:14:08