hi, i am been busy for a few week a go. from the oracle form i move 180 deagrees to learn C# mobile and asp.net, because of that i will tell you what i knew about that.
today i will share about C# mobile application. i use this application for windows ce 2.0 , in this case it's require .net compact edition 2.0 , sql compact edition 2.0. it's not same with vb.net that i had been learn, c# it's more same like java but had a little complicate way to use it.
in c# application for mobile application or desktop application it's use it program.cs , program.cs it's like a main program, the program that we execute in c# it's run from program.cs
the different think's with vb.net it's like syntax formname.close, if in vb.net it's will close the form that we want to be closed , but in C# it's will be close the application(because of that you must aware about this action u choose). to handle this problem you can use formname.hide()
this way it's had to use it's, because of that in c# mobile application if we don't initialization the form as object the form will exist the hide event. for handle that problem i use this way.
in program.cs
static class Program
{
/* in this line i initialization the form with public and static
public static frmtest ofrmtest = new frmtest();
*/
[MTAThread]
static void Main()
{
Application.Run(form1);
}
}
to use this object you just put Program.ofrmtest.Show();
if you use Program.ofrmtest.Close(); the form can't be open again, because the object you had been destroyed. because of that u must use Program.ofrmtest.Hide(); or you can make a event with static method. like this;
static class Program
{
[MTAThread]
static void Main()
{
Application.Run(form1);
}
public static void OpenFormTest()
{
ofrmtest = new frmtest();
ofrmtest.Show();
}
public static voide CloseFormTest(form frm)
{
Form frmTrans= frm;
frmTrans.Close();
}
}
to use this method in form1 events form_load just put Program.OpenFormTest();
to close the form in frmtest you can use CloseFormTest(this);
well that's it.... bye bye...
in c# application for mobile application or desktop application it's use it program.cs , program.cs it's like a main program, the program that we execute in c# it's run from program.cs
the different think's with vb.net it's like syntax formname.close, if in vb.net it's will close the form that we want to be closed , but in C# it's will be close the application(because of that you must aware about this action u choose). to handle this problem you can use formname.hide()
this way it's had to use it's, because of that in c# mobile application if we don't initialization the form as object the form will exist the hide event. for handle that problem i use this way.
in program.cs
static class Program
{
/* in this line i initialization the form with public and static
public static frmtest ofrmtest = new frmtest();
*/
[MTAThread]
static void Main()
{
Application.Run(form1);
}
}
to use this object you just put Program.ofrmtest.Show();
if you use Program.ofrmtest.Close(); the form can't be open again, because the object you had been destroyed. because of that u must use Program.ofrmtest.Hide(); or you can make a event with static method. like this;
static class Program
{
[MTAThread]
static void Main()
{
Application.Run(form1);
}
public static void OpenFormTest()
{
ofrmtest = new frmtest();
ofrmtest.Show();
}
public static voide CloseFormTest(form frm)
{
Form frmTrans= frm;
frmTrans.Close();
}
}
to use this method in form1 events form_load just put Program.OpenFormTest();
to close the form in frmtest you can use CloseFormTest(this);
well that's it.... bye bye...