Ich bin neu in der Codierung. Ich kann nicht herausfinden, warum meine Textbox Text in Windows-Formularen mit C# nicht anzeigen wird. Hier ist mein Code.Textbox wird nicht wie erwartet angezeigt
public partial class Form1
{
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
Form1 myTestObject = new Form1();
myTestObject.myTextPanel("hello");
}
public void myTextPanel(string myText)
{
// Windows Forms textBox1
textBox1.Text = myText;
}
}
Ich habe eine Antwort unten geschrieben, Könnten Sie bitte einen Blick, lassen Sie mich wissen, wenn Sie weitere Details oder Erklärung benötigen ..! –