-
August 30th, 2015, 10:51 AM
#1
A basic question about a missing }
Sorry for bringing such a basic question to the table, but it is truly stumping me. My compiler (command line, visual C# compiler version 4.0.30319.34209, .NET Framework 4.5) indicates a missing bracket on the second line of this function (where the { is), and I am sure it must be something obvious but I simply cannot see it. This is my first attempt at creating a GUI in C#, so I am very much a novice.
Code:
private void AddMovieInfo_Click(object sender, System.EventArgs e)
{
private Label AMILabelName;
private TextBox AMITextName;
private Label AMILabelRating;
private TextBox AMITextRating;
private Button AMIAdd;
private Button AMIClose;
Form AMI = new Form();
AMI.Text = "Add Movie Information";
AMILabelName = new Label();
AMITextName = new TextBox();
AMILabelRating = new Label();
AMITextRating = new TextBox();
AMIAdd = new Button();
AMIClose = new Button();
Controls.Add(AMILabelName);
Controls.Add(AMITextName);
Controls.Add(AMILabelRating);
Controls.Add(AMITextRating);
Controls.Add(AMIAdd);
Controls.Add(AMIClose);
AMILabelName.Text = "Movie name?";
AMILabelRating.Text = "Movie Rating?";
AMIAdd.Text = "Add";
AMIClose.Text = "Close";
AMIAdd.Click += new System.EventHandler(AMIAdd_Click);
AMIClose.Click += new System.EventHandler(AMIClose_Click);
AMI.ShowDialog();
}
-
August 30th, 2015, 02:06 PM
#2
Re: A basic question about a missing }
I'm so sorry, please disregard this - I figured it out myself! Those variables are not supposed to be designated as private.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|