पुस्तक का पालन कर रहा हूं, मैं एक नौसिखिया हूं और मैं एक पुस्तक के बाद अभ्यास कर रहा हूं। नीचे मेरा कोड है और मैं इसघोषणा पर आंशिक संशोधक गुमराह .. इस प्रकार की अन्य आंशिक घोषणा मौजूद है। "मैं एक नौसिखिया हूं और बस
"Missing partial modifier on declaration of type 'Windowsform.Form1'; another partial declaration of this type exists"
मिला
मैं क्या करना चाहिए इस प्रकार मेरे कोड है:।? यह है
using System;
using System.Windows.Forms;
namespace Windowsform
{
public class Form1 : Form
{
private TextBox txtEnter;
private Label lblDisplay;
private Button btnOk;
public Form1()
{
this.txtEnter = new TextBox();
this.lblDisplay = new Label();
this.btnOk = new Button();
this.Text = "My Hellowin app!";
//txtEnter
this.txtEnter.Location = new System.Drawing.Point(16, 32);
this.txtEnter.Size = new System.Drawing.Size(264, 20);
//lblDisplay
this.lblDisplay.Location = new System.Drawing.Point(16, 72);
this.lblDisplay.Size = new System.Drawing.Size(264, 128);
//btnOK
this.btnOk.Location = new System.Drawing.Point(88, 224);
this.btnOk.Text = "OK";
this.btnOk.Click +=
new System.EventHandler(this.btnOK_Click);
//MyForm
this.Controls.AddRange(new Control[] {
this.txtEnter, this.lblDisplay, this.btnOk});
}
static void Main()
{
Application.Run(new Form1());
}
private void btnOK_Click(object sender, System.EventArgs e)
{
lblDisplay.Text = txtEnter.Text + "\n" + lblDisplay.Text;
}
}
}
@ user1742237 मुझे लगता है कि आप डिफ़ॉल्ट प्रोग्राम वर्ग उत्पन्न Form1 घोषणा लेकिन आम तौर पर एक WinForms आवेदन के लिए टेम्पलेट शामिल करने के लिए बदलने के लिए किया था एक खाली साथ एक उत्पन्न Form1 वर्ग भी शामिल है प्रपत्र। बस इसे हटा दें। –
मुझे वास्तविक सीधी-आगे, कोड उन्मुख उत्तर खोजने के लिए अब तक स्क्रॉल करना पड़ा था? StackOverflow पर? ... – mmcrae