I have a class A and class B
Class A has:
public int ID
{
get;
set;
}
when running program a value is assigned to ID ex:123 and destroyed when form is closed and set a default value i.e = 0
Ques: how can i save the value in class B before it get destroyed?
so i can have the can access the value in class B and perform validation.
Let me suppose that
Class AandClass Bare win-forms and you are openingAfromB. Write in formAa method like:Also in
A‘s constructor write following lineIn form
Bwrite following to open formA:Now
icontains value ofID.