its better that i will explain you with an example
public partial class Form1 : Form
{
int i;
public
Form1()
{
InitializeComponent();
i = 10;
// when
we access i , it will be accessible, because it is in
// class
scope variable, it will be alive till the life of
//
object.
int
j = 10;
// here j scope
is within the block( between this { }) only
//
whenver block is completer it will not be acceccese outsite(see form1_load
event).
// it
will not be more alive.
}
private
void Form1_Load(object
sender, EventArgs e)
{
i = 20;
//j =20;
// when
we write statement j=20, it will give as error
//
because there is no variable named "j"
}
}