Hi Dear AssanKhan Ismail,
You can return more than one (1) value or type by constructing a class and
returning that class in your function.
for example:
========
Construct a class like this with 4 Different Types like bool, int, double,
string
public class Different_Types
{
public Different_Types()
{
//
// TODO: Add constructor logic here
//
}
int m_int;
string m_str;
bool m_bool;
double m_double;
public int PassInteger
{
get {return m_int;}
set {m_int = value;}
}
public string PassString
{
get {return m_str;}
set {m_str = value;}
}
public bool PassBoolean
{
get {return m_bool;}
set {m_bool = value;}
}
public double PassDouble
{
get {return m_double;}
set {m_double = value;}
}
}
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Then Create you Function which return 4 Different Types of Values ( but all
the 4 different types of values pass through the object which is created the
class above
function name is = Returen_Many_Values_CLASS
it returns the type of object = Different_Types
for this object you have created a class above
public Different_Types Returen_Many_Values_CLASS()
{
Different_Types diff_types = new Different_Types();
diff_types.PassBoolean=false;
diff_types.PassDouble=3.142;
diff_types.PassInteger=67;
diff_types.PassString="Venkat";
return diff_types;
}
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Use the above function in a button click and populate 4 different textboxes
for this you have to place 4 different textboxes and one command button
private void button1_Click(object sender, System.EventArgs e)
{
this.textBox1.Text=Returen_Many_Values_CLASS().PassBoolean.ToString();
this.textBox2.Text=Returen_Many_Values_CLASS().PassDouble.ToString();
this.textBox3.Text=Returen_Many_Values_CLASS().PassInteger.ToString();
this.textBox4.Text=Returen_Many_Values_CLASS().PassString;
}
You can test this one in one dummy windows application in .net
for Anything and Everything, Please Let Me Know
bye
Venkat_KL