即時編寫在Visual Studio中的應用程序,並試圖從其他類訪問富文本框。這似乎不適用於我。另外如何從其他類調用函數?Visual C#從其他類文件訪問項目
我的代碼:
namespace Test{
public partial class Form1 : Form
{
public Form1()
{
// I want from this place to access the MyClass.test("hello");
}
}
}
namespace Test{
class MyClass
{
public void test (string text)
{
// here i want to do richtextbox1.clear(); but the textbox is not available
}
}
}
歡迎來到Stack Overflow。與其刪除並重新發布相同的答案,您可以點擊答案下方的「編輯」來改進它。 :) – CodeCaster 2014-10-10 11:37:52