CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2015
    Posts
    2

    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();		 
    	}

  2. #2
    Join Date
    Aug 2015
    Posts
    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
  •  





Click Here to Expand Forum to Full Width

Featured