none
Having issues with code view

    Question

  • hello, I'm new to this, so forgive me if I am not making sense, So once you start a new project, and go to code view from using the form. there's this problem. So when im in Uni using the visual studio, the code view will have the usual private and public code, and I continue whatever my task is to do

    however, when I am using visual studio on my laptop at home, the code view has public partial and private void. this is confusing and I would like to know it there is a solution.

    Saturday, November 28, 2015 8:33 PM

Answers

  • Hi Immy, I'm not sure what you mean. Normally you would see something like this.

     public partial class Form1 : Form
        {
            
            public Form1()
            {
                InitializeComponent();
    
    
                
            }
    
            private void button1_Click(object sender, EventArgs e)
            {
    
            }
        }

    If that's what you see then that's normal. Otherwise how about posting a snap shot of what you see.

    Cheers.

    Sunday, November 29, 2015 1:50 AM
  • Thanks for Michael_66's help.

    Like Michael_66's suggestion, if you create a default Winform app like the following screen shot 1, and then click form1.cs file, you would get the result like the screen shot 2.

    >>however, when I am using visual studio on my laptop at home, the code view has public partial and private void. this is confusing and I would like to know it there is a solution.

    If you get diffferent result, please make sure that you use the same VS version, and create the same project type.

    Please also make sure that you open the correct .cs file, for example, if you don't open the Form1.cs, but open the Form1.Designer.cs file, you could get different code view.

    Best Regards,

    Jack


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, November 30, 2015 12:11 PM
    Moderator

All replies

  • Hi Immy, I'm not sure what you mean. Normally you would see something like this.

     public partial class Form1 : Form
        {
            
            public Form1()
            {
                InitializeComponent();
    
    
                
            }
    
            private void button1_Click(object sender, EventArgs e)
            {
    
            }
        }

    If that's what you see then that's normal. Otherwise how about posting a snap shot of what you see.

    Cheers.

    Sunday, November 29, 2015 1:50 AM
  • Thanks for Michael_66's help.

    Like Michael_66's suggestion, if you create a default Winform app like the following screen shot 1, and then click form1.cs file, you would get the result like the screen shot 2.

    >>however, when I am using visual studio on my laptop at home, the code view has public partial and private void. this is confusing and I would like to know it there is a solution.

    If you get diffferent result, please make sure that you use the same VS version, and create the same project type.

    Please also make sure that you open the correct .cs file, for example, if you don't open the Form1.cs, but open the Form1.Designer.cs file, you could get different code view.

    Best Regards,

    Jack


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, November 30, 2015 12:11 PM
    Moderator