Note that there are some explanatory texts on larger screens.

plurals
  1. POwhich code block to write and where to reach and assign?
    primarykey
    data
    text
    <p>which code block to write and where to reach and assign? hi to all sorry for the basic question but i will be happy if you can explain some Qs below. thanks.</p> <pre><code> namespace forms { public partial class Form1 : Form { public Form1() { InitializeComponent(); // in thic code block what kind of things can i write or im allowed to write? Q1 } Form2 frm2 = new Form2(); // why should i write this line (since i already added form2 to my project as seen in the picture) ![enter image description here][1]to see frm2.Show(); in button1_Click part? Q2 //what happens in the background (from the compiler point of view) when i do Form2 frm2 = new Form2();? Q3 frm2.Show(); // why cant i reach frm2 in here? i just declared above. Q4 //just like that int number1; // i declare number variable in here number1= 5; // and why cant i assign number in here? // what kind of things can i write or allowed to write in this block ? Q5 // i sometimes confuse where i need to start writing the code or where i need to write or in which block ? public int number2; // ok now lets say i put a button on the form and when i double click it generated the code down below //and now lets look in that code block private void button1_Click(object sender, EventArgs e) { // ok now we are in this block and now it see when i write frm2.Show(); //or //it see when i write number1 = 5; //ok now lets look at number1 and number2 what changes when i write public int and just int without public? Q6 } } } </code></pre> <p><img src="https://i.stack.imgur.com/HPYHt.png" alt="enter image description here"></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload