K...this is making me crazy! First, I only have two forms...

The Splash screen is the main()

I used to do this:

static void Main()
{
Application.Run(new frmSplashScreen());
}

....Initialize Code...

private void frmSplashScreen_Load(object sender, EventArgs e)
{
this.Update();
this.Show();
frmCommunities mainForm = new frmCommunities();
this.Hide();
mainForm.Show();
}

This was no problem and worked fine.

Now I am working in Visual Studio 2005 and this doesn't work. What the HE!!

Some noteable differences. VS '05 creates a program.cs which is the Main()

static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>

[MTAThread]
static void Main()
{
Application.Run(new frmSplash());
}

}


...then there is the Designer.cs that is a partial class and contains the
InitializeComponent code...

I placed my code in the partial class and here it is....

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlServerCe;
using System.Reflection;
using System.IO;

namespace eScheduleMobile
{
public partial class frmSplash : Form
{
#region variables
private DataManager DM;
private frmLogin Login;
#endregion

public frmSplash()
{
InitializeComponent();
}

private void Splash_Load(object sender, EventArgs e)
{
this.Show();
this.Refresh();

if (!ConfigApp())
{
Application.Exit();
}

Login.Show();
Login.Refresh();
this.Hide();
}

private bool ConfigApp()
{
bool AppReady = false;
DM = new DataManager();

try
{
if (!initDB())
{
this.lblMessage.Text = "Failed to create data file.
Application will exit.";
this.lblMessage.Refresh();
AppReady = false;
}
else
{
this.lblMessage.Text = "Data file was updated.";
this.lblMessage.Refresh();
AppReady = true;
}
if (!initLogin())
{
this.lblMessage.Text = "Login form could not be created.";
this.lblMessage.Refresh();
AppReady = false;
}
else
{
this.lblMessage.Text = "Configuration complete.";
this.lblMessage.Refresh();
AppReady = true;
}
}
catch
{

}

return AppReady;
}

private bool initDB()
{
try
{
//Check to see if data file (sdf) was created.
//If not, 'CheckDB will create one.
if (DM.CheckDB(false))
{
//Now we add Tables and Indices using the
'eScheduleMobile.DB.xml' config file
if (!DM.CreateDatabase())
{
this.lblMessage.Text = "Data Failure. Failed to
create tables.";
this.lblMessage.Refresh();
return false;
}
if (!DM.CreateIndices())
{
this.lblMessage.Text = "Data Failure. Failed to
create indices.";
this.lblMessage.Refresh();
return false;
}

this.lblMessage.Text = "Data file created.";
this.lblMessage.Refresh();
}
}
catch
{

}

//Return true if DB was created or already exists.
return true;
}

private bool initLogin()
{
Login = new frmLogin();
return true;
}

private void btnContinue_Click(object sender, EventArgs e)
{
Login.Show();
Login.Refresh();
this.Hide();
}
}
}



....K, The Splash page shows and displays updates as data is created and the
login form is created. The login form should be displayed and the Splash page
hidden. It works right up until the Load event ends. Then the hidden Splash
page is AGAIN displayed, even after I told it to Hide.

Side note: WORKS GREAT IF I CLICK THE BUTTON. Just not in the load even
....WHY, why oh why....
--
Charcoal
Going Mobile...Keep me moving.

RE: Show/Hide Forms by Charcoal

Charcoal
Wed Dec 14 11:36:04 CST 2005

Ok..maybe I can make this easier to understandâ?¦.

Why doesnâ??t this work in the form_Load event? (I am using Visual Studio
2005, compact framework 2.0 and testing on a Dell Axim using Mobile 5.0 OS)

static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>

[MTAThread]
static void Main()
{
Application.Run(new frmSplash());
}

}


private void Splash_Load(object sender, EventArgs e)
{
this.Show();
this.Refresh();

frmLogin Login = new frmLogin();

Login.Show();
Login.Refresh();
this.Hide();
}

Every time I try, the frmSplash (AKA this) is shown, frmLogin (AKA Login) is
created, frmLogin is shown, frmSplash hides, at the end of the load method
frmSplash is made visible and is the topmost form!!!!!!!

Please, for the love of God and all that is holy...please help. Thanks

--
Charcoal
Going Mobile...Keep me moving.


"Charcoal" wrote:

> K...this is making me crazy! First, I only have two forms...
>
> The Splash screen is the main()
>
> I used to do this:
>
> static void Main()
> {
> Application.Run(new frmSplashScreen());
> }
>
> ....Initialize Code...
>
> private void frmSplashScreen_Load(object sender, EventArgs e)
> {
> this.Update();
> this.Show();
> frmCommunities mainForm = new frmCommunities();
> this.Hide();
> mainForm.Show();
> }
>
> This was no problem and worked fine.
>
> Now I am working in Visual Studio 2005 and this doesn't work. What the HE!!
>
> Some noteable differences. VS '05 creates a program.cs which is the Main()
>
> static class Program
> {
> /// <summary>
> /// The main entry point for the application.
> /// </summary>
>
> [MTAThread]
> static void Main()
> {
> Application.Run(new frmSplash());
> }
>
> }
>
>
> ...then there is the Designer.cs that is a partial class and contains the
> InitializeComponent code...
>
> I placed my code in the partial class and here it is....
>
> using System;
> using System.Collections.Generic;
> using System.ComponentModel;
> using System.Data;
> using System.Drawing;
> using System.Text;
> using System.Windows.Forms;
> using System.Data.SqlServerCe;
> using System.Reflection;
> using System.IO;
>
> namespace eScheduleMobile
> {
> public partial class frmSplash : Form
> {
> #region variables
> private DataManager DM;
> private frmLogin Login;
> #endregion
>
> public frmSplash()
> {
> InitializeComponent();
> }
>
> private void Splash_Load(object sender, EventArgs e)
> {
> this.Show();
> this.Refresh();
>
> if (!ConfigApp())
> {
> Application.Exit();
> }
>
> Login.Show();
> Login.Refresh();
> this.Hide();
> }
>
> private bool ConfigApp()
> {
> bool AppReady = false;
> DM = new DataManager();
>
> try
> {
> if (!initDB())
> {
> this.lblMessage.Text = "Failed to create data file.
> Application will exit.";
> this.lblMessage.Refresh();
> AppReady = false;
> }
> else
> {
> this.lblMessage.Text = "Data file was updated.";
> this.lblMessage.Refresh();
> AppReady = true;
> }
> if (!initLogin())
> {
> this.lblMessage.Text = "Login form could not be created.";
> this.lblMessage.Refresh();
> AppReady = false;
> }
> else
> {
> this.lblMessage.Text = "Configuration complete.";
> this.lblMessage.Refresh();
> AppReady = true;
> }
> }
> catch
> {
>
> }
>
> return AppReady;
> }
>
> private bool initDB()
> {
> try
> {
> //Check to see if data file (sdf) was created.
> //If not, 'CheckDB will create one.
> if (DM.CheckDB(false))
> {
> //Now we add Tables and Indices using the
> 'eScheduleMobile.DB.xml' config file
> if (!DM.CreateDatabase())
> {
> this.lblMessage.Text = "Data Failure. Failed to
> create tables.";
> this.lblMessage.Refresh();
> return false;
> }
> if (!DM.CreateIndices())
> {
> this.lblMessage.Text = "Data Failure. Failed to
> create indices.";
> this.lblMessage.Refresh();
> return false;
> }
>
> this.lblMessage.Text = "Data file created.";
> this.lblMessage.Refresh();
> }
> }
> catch
> {
>
> }
>
> //Return true if DB was created or already exists.
> return true;
> }
>
> private bool initLogin()
> {
> Login = new frmLogin();
> return true;
> }
>
> private void btnContinue_Click(object sender, EventArgs e)
> {
> Login.Show();
> Login.Refresh();
> this.Hide();
> }
> }
> }
>
>
>
> ....K, The Splash page shows and displays updates as data is created and the
> login form is created. The login form should be displayed and the Splash page
> hidden. It works right up until the Load event ends. Then the hidden Splash
> page is AGAIN displayed, even after I told it to Hide.
>
> Side note: WORKS GREAT IF I CLICK THE BUTTON. Just not in the load even
> ....WHY, why oh why....
> --
> Charcoal
> Going Mobile...Keep me moving.

Re: Show/Hide Forms by Chris

Chris
Wed Dec 14 13:08:13 CST 2005

How about this? A lot less shenanigans going on.

static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>

[MTAThread]
static void Main()
{
Application.Run(new frmSplash());
Application.Run(new frmLogin());
}

}
}

--
Chris Tacke
Co-founder
OpenNETCF.org
Are you using the SDF? Let's do a case study.
Email us at d c s @ o p e n n e t c f . c o m
http://www.opennetcf.org/donate


"Charcoal" <Charcoal@discussions.microsoft.com> wrote in message
news:64C9B77C-796D-48D2-92B1-5DC2D461D613@microsoft.com...
> Ok..maybe I can make this easier to understand..
>
> Why doesn't this work in the form_Load event? (I am using Visual Studio
> 2005, compact framework 2.0 and testing on a Dell Axim using Mobile 5.0
> OS)
>
> static class Program
> {
> /// <summary>
> /// The main entry point for the application.
> /// </summary>
>
> [MTAThread]
> static void Main()
> {
> Application.Run(new frmSplash());
> }
>
> }
>
>
> private void Splash_Load(object sender, EventArgs e)
> {
> this.Show();
> this.Refresh();
>
> frmLogin Login = new frmLogin();
>
> Login.Show();
> Login.Refresh();
> this.Hide();
> }
>
> Every time I try, the frmSplash (AKA this) is shown, frmLogin (AKA Login)
> is
> created, frmLogin is shown, frmSplash hides, at the end of the load method
> frmSplash is made visible and is the topmost form!!!!!!!
>
> Please, for the love of God and all that is holy...please help. Thanks
>
> --
> Charcoal
> Going Mobile...Keep me moving.
>
>
> "Charcoal" wrote:
>
>> K...this is making me crazy! First, I only have two forms...
>>
>> The Splash screen is the main()
>>
>> I used to do this:
>>
>> static void Main()
>> {
>> Application.Run(new frmSplashScreen());
>> }
>>
>> ....Initialize Code...
>>
>> private void frmSplashScreen_Load(object sender, EventArgs e)
>> {
>> this.Update();
>> this.Show();
>> frmCommunities mainForm = new frmCommunities();
>> this.Hide();
>> mainForm.Show();
>> }
>>
>> This was no problem and worked fine.
>>
>> Now I am working in Visual Studio 2005 and this doesn't work. What the
>> HE!!
>>
>> Some noteable differences. VS '05 creates a program.cs which is the
>> Main()
>>
>> static class Program
>> {
>> /// <summary>
>> /// The main entry point for the application.
>> /// </summary>
>>
>> [MTAThread]
>> static void Main()
>> {
>> Application.Run(new frmSplash());
>> }
>>
>> }
>>
>>
>> ...then there is the Designer.cs that is a partial class and contains the
>> InitializeComponent code...
>>
>> I placed my code in the partial class and here it is....
>>
>> using System;
>> using System.Collections.Generic;
>> using System.ComponentModel;
>> using System.Data;
>> using System.Drawing;
>> using System.Text;
>> using System.Windows.Forms;
>> using System.Data.SqlServerCe;
>> using System.Reflection;
>> using System.IO;
>>
>> namespace eScheduleMobile
>> {
>> public partial class frmSplash : Form
>> {
>> #region variables
>> private DataManager DM;
>> private frmLogin Login;
>> #endregion
>>
>> public frmSplash()
>> {
>> InitializeComponent();
>> }
>>
>> private void Splash_Load(object sender, EventArgs e)
>> {
>> this.Show();
>> this.Refresh();
>>
>> if (!ConfigApp())
>> {
>> Application.Exit();
>> }
>>
>> Login.Show();
>> Login.Refresh();
>> this.Hide();
>> }
>>
>> private bool ConfigApp()
>> {
>> bool AppReady = false;
>> DM = new DataManager();
>>
>> try
>> {
>> if (!initDB())
>> {
>> this.lblMessage.Text = "Failed to create data file.
>> Application will exit.";
>> this.lblMessage.Refresh();
>> AppReady = false;
>> }
>> else
>> {
>> this.lblMessage.Text = "Data file was updated.";
>> this.lblMessage.Refresh();
>> AppReady = true;
>> }
>> if (!initLogin())
>> {
>> this.lblMessage.Text = "Login form could not be
>> created.";
>> this.lblMessage.Refresh();
>> AppReady = false;
>> }
>> else
>> {
>> this.lblMessage.Text = "Configuration complete.";
>> this.lblMessage.Refresh();
>> AppReady = true;
>> }
>> }
>> catch
>> {
>>
>> }
>>
>> return AppReady;
>> }
>>
>> private bool initDB()
>> {
>> try
>> {
>> //Check to see if data file (sdf) was created.
>> //If not, 'CheckDB will create one.
>> if (DM.CheckDB(false))
>> {
>> //Now we add Tables and Indices using the
>> 'eScheduleMobile.DB.xml' config file
>> if (!DM.CreateDatabase())
>> {
>> this.lblMessage.Text = "Data Failure. Failed to
>> create tables.";
>> this.lblMessage.Refresh();
>> return false;
>> }
>> if (!DM.CreateIndices())
>> {
>> this.lblMessage.Text = "Data Failure. Failed to
>> create indices.";
>> this.lblMessage.Refresh();
>> return false;
>> }
>>
>> this.lblMessage.Text = "Data file created.";
>> this.lblMessage.Refresh();
>> }
>> }
>> catch
>> {
>>
>> }
>>
>> //Return true if DB was created or already exists.
>> return true;
>> }
>>
>> private bool initLogin()
>> {
>> Login = new frmLogin();
>> return true;
>> }
>>
>> private void btnContinue_Click(object sender, EventArgs e)
>> {
>> Login.Show();
>> Login.Refresh();
>> this.Hide();
>> }
>> }
>> }
>>
>>
>>
>> ....K, The Splash page shows and displays updates as data is created and
>> the
>> login form is created. The login form should be displayed and the Splash
>> page
>> hidden. It works right up until the Load event ends. Then the hidden
>> Splash
>> page is AGAIN displayed, even after I told it to Hide.
>>
>> Side note: WORKS GREAT IF I CLICK THE BUTTON. Just not in the load even
>> ....WHY, why oh why....
>> --
>> Charcoal
>> Going Mobile...Keep me moving.



Re: Show/Hide Forms by Charcoal

Charcoal
Thu Dec 15 13:22:02 CST 2005

Not sure that would help. Maybe I don't understand...but,
Application.Run(new frmLogin());
would never run after
Application.Run(new frmSplash());
the way you suggest...I could be wrong...

I could do..
Application.Run(new frmSplash(new frmLogin()));
...but that is no better that just,
Application.Run(new frmSplash());
..and within the frmSplash Load event doing,
frmLogin Login = new frmLogin();

I still have the same problem with SHOW/HIDE...

Also, the splash page is used to setup/validate a data file, init the login
form, and a few other things. I provide the user with information as the
application loads by refreshing a label after each process. With your
suggestion the frmLogin object is not even created yet, both forms would get
created before I can even provide the user with update messages...

If anybody has a sample of code that will solve this riddle I would add you
to my Christmas list...but you have to hurry cause Christmas is just around
the corner :-)

Again, the old way (windows CE) was to:

Application.Run(new frmSplash());

...and in the frmSplash_Load event I could do everything...ie

frmSplash.update();
frmSplash.Show();
frmLogin Login = new Login();
Login.Show();
frmSplash.Hide();

...it worked great!! What the heck has changed in Mobile 5.0?? Or maybe all
the years of crack smokin is taking it's toll on me....

You all must try this.
1. Use visual studio 2005
2. Create a solution to run on windows mobile 5.0 device
3. Add a form2
4. In the load event of Form1 (your default form and the one created by
main()), show, refresh your form1.
5. Create a new form2 obj
6. Hide Form1 and Show Form2

...at the end of the Form1 load event the Form1 will be displayed AGAIN and
is the topmost!!! It doesn't matter if you set visible = false. It doesn't
matter if you call, paint event, click event, deactivate, closing, etc...you
still have to exit the load event AND THAT IS WHERE IT GETS YOU!!!
AUUUUGGGGHHHHHH

HELP ME GOD PLEASE!!

Thanks, sorry to get so carried away.


--
Charcoal
Going Mobile...Keep me moving.


"Chris Tacke, eMVP" wrote:

> How about this? A lot less shenanigans going on.
>
> static class Program
> {
> /// <summary>
> /// The main entry point for the application.
> /// </summary>
>
> [MTAThread]
> static void Main()
> {
> Application.Run(new frmSplash());
> Application.Run(new frmLogin());
> }
>
> }
> }
>
> --
> Chris Tacke
> Co-founder
> OpenNETCF.org
> Are you using the SDF? Let's do a case study.
> Email us at d c s @ o p e n n e t c f . c o m
> http://www.opennetcf.org/donate
>
>
> "Charcoal" <Charcoal@discussions.microsoft.com> wrote in message
> news:64C9B77C-796D-48D2-92B1-5DC2D461D613@microsoft.com...
> > Ok..maybe I can make this easier to understand..
> >
> > Why doesn't this work in the form_Load event? (I am using Visual Studio
> > 2005, compact framework 2.0 and testing on a Dell Axim using Mobile 5.0
> > OS)
> >
> > static class Program
> > {
> > /// <summary>
> > /// The main entry point for the application.
> > /// </summary>
> >
> > [MTAThread]
> > static void Main()
> > {
> > Application.Run(new frmSplash());
> > }
> >
> > }
> >
> >
> > private void Splash_Load(object sender, EventArgs e)
> > {
> > this.Show();
> > this.Refresh();
> >
> > frmLogin Login = new frmLogin();
> >
> > Login.Show();
> > Login.Refresh();
> > this.Hide();
> > }
> >
> > Every time I try, the frmSplash (AKA this) is shown, frmLogin (AKA Login)
> > is
> > created, frmLogin is shown, frmSplash hides, at the end of the load method
> > frmSplash is made visible and is the topmost form!!!!!!!
> >
> > Please, for the love of God and all that is holy...please help. Thanks
> >
> > --
> > Charcoal
> > Going Mobile...Keep me moving.
> >
> >
> > "Charcoal" wrote:
> >
> >> K...this is making me crazy! First, I only have two forms...
> >>
> >> The Splash screen is the main()
> >>
> >> I used to do this:
> >>
> >> static void Main()
> >> {
> >> Application.Run(new frmSplashScreen());
> >> }
> >>
> >> ....Initialize Code...
> >>
> >> private void frmSplashScreen_Load(object sender, EventArgs e)
> >> {
> >> this.Update();
> >> this.Show();
> >> frmCommunities mainForm = new frmCommunities();
> >> this.Hide();
> >> mainForm.Show();
> >> }
> >>
> >> This was no problem and worked fine.
> >>
> >> Now I am working in Visual Studio 2005 and this doesn't work. What the
> >> HE!!
> >>
> >> Some noteable differences. VS '05 creates a program.cs which is the
> >> Main()
> >>
> >> static class Program
> >> {
> >> /// <summary>
> >> /// The main entry point for the application.
> >> /// </summary>
> >>
> >> [MTAThread]
> >> static void Main()
> >> {
> >> Application.Run(new frmSplash());
> >> }
> >>
> >> }
> >>
> >>
> >> ...then there is the Designer.cs that is a partial class and contains the
> >> InitializeComponent code...
> >>
> >> I placed my code in the partial class and here it is....
> >>
> >> using System;
> >> using System.Collections.Generic;
> >> using System.ComponentModel;
> >> using System.Data;
> >> using System.Drawing;
> >> using System.Text;
> >> using System.Windows.Forms;
> >> using System.Data.SqlServerCe;
> >> using System.Reflection;
> >> using System.IO;
> >>
> >> namespace eScheduleMobile
> >> {
> >> public partial class frmSplash : Form
> >> {
> >> #region variables
> >> private DataManager DM;
> >> private frmLogin Login;
> >> #endregion
> >>
> >> public frmSplash()
> >> {
> >> InitializeComponent();
> >> }
> >>
> >> private void Splash_Load(object sender, EventArgs e)
> >> {
> >> this.Show();
> >> this.Refresh();
> >>
> >> if (!ConfigApp())
> >> {
> >> Application.Exit();
> >> }
> >>
> >> Login.Show();
> >> Login.Refresh();
> >> this.Hide();
> >> }
> >>
> >> private bool ConfigApp()
> >> {
> >> bool AppReady = false;
> >> DM = new DataManager();
> >>
> >> try
> >> {
> >> if (!initDB())
> >> {
> >> this.lblMessage.Text = "Failed to create data file.
> >> Application will exit.";
> >> this.lblMessage.Refresh();
> >> AppReady = false;
> >> }
> >> else
> >> {
> >> this.lblMessage.Text = "Data file was updated.";
> >> this.lblMessage.Refresh();
> >> AppReady = true;
> >> }
> >> if (!initLogin())
> >> {
> >> this.lblMessage.Text = "Login form could not be
> >> created.";
> >> this.lblMessage.Refresh();
> >> AppReady = false;
> >> }
> >> else
> >> {
> >> this.lblMessage.Text = "Configuration complete.";
> >> this.lblMessage.Refresh();
> >> AppReady = true;
> >> }
> >> }
> >> catch
> >> {
> >>
> >> }
> >>
> >> return AppReady;
> >> }
> >>
> >> private bool initDB()
> >> {
> >> try
> >> {
> >> //Check to see if data file (sdf) was created.
> >> //If not, 'CheckDB will create one.
> >> if (DM.CheckDB(false))
> >> {
> >> //Now we add Tables and Indices using the
> >> 'eScheduleMobile.DB.xml' config file
> >> if (!DM.CreateDatabase())
> >> {
> >> this.lblMessage.Text = "Data Failure. Failed to
> >> create tables.";
> >> this.lblMessage.Refresh();
> >> return false;
> >> }
> >> if (!DM.CreateIndices())
> >> {
> >> this.lblMessage.Text = "Data Failure. Failed to
> >> create indices.";
> >> this.lblMessage.Refresh();
> >> return false;
> >> }
> >>
> >> this.lblMessage.Text = "Data file created.";
> >> this.lblMessage.Refresh();
> >> }
> >> }
> >> catch
> >> {
> >>
> >> }
> >>
> >> //Return true if DB was created or already exists.
> >> return true;
> >> }
> >>
> >> private bool initLogin()
> >> {
> >> Login = new frmLogin();
> >> return true;
> >> }
> >>
> >> private void btnContinue_Click(object sender, EventArgs e)
> >> {
> >> Login.Show();
> >> Login.Refresh();
> >> this.Hide();
> >> }
> >> }
> >> }
> >>
> >>
> >>
> >> ....K, The Splash page shows and displays updates as data is created and
> >> the
> >> login form is created. The login form should be displayed and the Splash
> >> page
> >> hidden. It works right up until the Load event ends. Then the hidden
> >> Splash
> >> page is AGAIN displayed, even after I told it to Hide.
> >>
> >> Side note: WORKS GREAT IF I CLICK THE BUTTON. Just not in the load even
> >> ....WHY, why oh why....
> >> --
> >> Charcoal
> >> Going Mobile...Keep me moving.
>
>
>

Re: Show/Hide Forms by Chris

Chris
Thu Dec 15 13:41:43 CST 2005

"Charcoal" <Charcoal@discussions.microsoft.com> wrote in message
news:BC140E5E-4216-4F4F-A6B3-55E1DF643EA6@microsoft.com...
> Not sure that would help. Maybe I don't understand...but,
> Application.Run(new frmLogin());
> would never run after
> Application.Run(new frmSplash());
> the way you suggest...I could be wrong...

Why wouldn't it run? When frmSplash is closed, where do you think execution
goes from there? Application.Run simply sets up a message pump on the Form
passed in. When the form is destroyed, the pump exits, which puts execution
back into Main.

> Also, the splash page is used to setup/validate a data file, init the
> login
> form, and a few other things. I provide the user with information as the
> application loads by refreshing a label after each process. With your
> suggestion the frmLogin object is not even created yet, both forms would
> get
> created before I can even provide the user with update messages...

Then you need an instance of it available to the splash form. Something
like this maybe?

static class Program
{
internal static frmLogin m_frmLogin = new frmLogin();

[MTAThread]
static void Main()
{
Application.Run(new frmSplash());
Application.Run(m_frmLogin);
}

}
}

Or this:

static class Program
{
[MTAThread]
static void Main()
{
frmLogin login = new frmLogin();
Application.Run(new frmSplash(login));
Application.Run(login);
}

}
}

>
> If anybody has a sample of code that will solve this riddle I would add
> you
> to my Christmas list...but you have to hurry cause Christmas is just
> around
> the corner :-)
>
> Again, the old way (windows CE) was to:
>
> Application.Run(new frmSplash());
>
> ...and in the frmSplash_Load event I could do everything...ie
>
> frmSplash.update();
> frmSplash.Show();
> frmLogin Login = new Login();
> Login.Show();
> frmSplash.Hide();
>
> ...it worked great!! What the heck has changed in Mobile 5.0?? Or maybe
> all
> the years of crack smokin is taking it's toll on me....

And I maintain this is a kludge.

-Chris



Re: Show/Hide Forms by Charcoal

Charcoal
Thu Dec 15 14:19:02 CST 2005

Oh, yes...I agree. If I close the splash then it will run the frmLogin. I
guess my goal was to create the Login form while still having Splash open.
That way I could use Splash to provide messages while Login gets created.

I guess itâ??s just a matter of taking a different approach to the problem. I
can still use Splash while most of the set up is being done (ie: data file
creation/validation, connection validation, service validation, etcâ?¦. I
suppose it isnâ??t necessary to inform the user when a form obj is created LOLâ?¦.

Still, I wish I knew why the old way doesnâ??t work anymore. I have included a
sample solution to HIDE/SHOW with your suggestion for everyone to review.
Thank you very much!

static void Main()
{
Application.Run(new frmSplash());
Application.Run(new frmLogin());
}

private void frmSplash_Load(object sender, EventArgs e)
{
displaySplash(true);

updateMessage("Updating data..");

displaySplash(false);

this.Close();
this.Dispose();
}

public void updateMessage(string msg)
{
this.lblSplash.Text = msg;
this.lblSplash.Refresh();
}

public void displaySplash(bool display)
{
if (display)
{
this.Show();
this.Refresh();
this.Enabled = true;
}
else
{
this.Enabled = false;
this.Hide();
}
}


=============Form 2=======================
private void frmLogin_Load(object sender, EventArgs e)
{
displayLogin(true);
}

public void displayLogin(bool display)
{
if (display)
{
this.Show();
this.Refresh();
this.Enabled = true;
this.txtUserName.Focus();
}
else
{
this.Enabled = false;
this.Hide();
}
}


Chris, Thank You.
--
Charcoal
Going Mobile...Keep me moving.


"Chris Tacke, eMVP" wrote:

> "Charcoal" <Charcoal@discussions.microsoft.com> wrote in message
> news:BC140E5E-4216-4F4F-A6B3-55E1DF643EA6@microsoft.com...
> > Not sure that would help. Maybe I don't understand...but,
> > Application.Run(new frmLogin());
> > would never run after
> > Application.Run(new frmSplash());
> > the way you suggest...I could be wrong...
>
> Why wouldn't it run? When frmSplash is closed, where do you think execution
> goes from there? Application.Run simply sets up a message pump on the Form
> passed in. When the form is destroyed, the pump exits, which puts execution
> back into Main.
>
> > Also, the splash page is used to setup/validate a data file, init the
> > login
> > form, and a few other things. I provide the user with information as the
> > application loads by refreshing a label after each process. With your
> > suggestion the frmLogin object is not even created yet, both forms would
> > get
> > created before I can even provide the user with update messages...
>
> Then you need an instance of it available to the splash form. Something
> like this maybe?
>
> static class Program
> {
> internal static frmLogin m_frmLogin = new frmLogin();
>
> [MTAThread]
> static void Main()
> {
> Application.Run(new frmSplash());
> Application.Run(m_frmLogin);
> }
>
> }
> }
>
> Or this:
>
> static class Program
> {
> [MTAThread]
> static void Main()
> {
> frmLogin login = new frmLogin();
> Application.Run(new frmSplash(login));
> Application.Run(login);
> }
>
> }
> }
>
> >
> > If anybody has a sample of code that will solve this riddle I would add
> > you
> > to my Christmas list...but you have to hurry cause Christmas is just
> > around
> > the corner :-)
> >
> > Again, the old way (windows CE) was to:
> >
> > Application.Run(new frmSplash());
> >
> > ...and in the frmSplash_Load event I could do everything...ie
> >
> > frmSplash.update();
> > frmSplash.Show();
> > frmLogin Login = new Login();
> > Login.Show();
> > frmSplash.Hide();
> >
> > ...it worked great!! What the heck has changed in Mobile 5.0?? Or maybe
> > all
> > the years of crack smokin is taking it's toll on me....
>
> And I maintain this is a kludge.
>
> -Chris
>
>
>

Re: Show/Hide Forms by Charcoal

Charcoal
Thu Dec 15 14:44:03 CST 2005

PSS. Chris, got any solutions to auto installing multiple CABs?? I'm only
running one instance of wceload.exe. If you search this forum on
'wceload.exe' or 'CAB' you will see details on this issue.

My setup dll is very simple and it too worked before. No such luck now and
it's no fun having to go into the mobile and run all the supporting CABs
after the applications initial install. Let me know if you need to see my
CABs ini setup, inf, or the steup.dll code. It's all pretty straight forward
and IT DID work. If you feel this is best resolved at a higher level let me
know so I can stop buggin everybody. :-) Thanks
--
Charcoal
Going Mobile...Keep me moving.


"Chris Tacke, eMVP" wrote:

> "Charcoal" <Charcoal@discussions.microsoft.com> wrote in message
> news:BC140E5E-4216-4F4F-A6B3-55E1DF643EA6@microsoft.com...
> > Not sure that would help. Maybe I don't understand...but,
> > Application.Run(new frmLogin());
> > would never run after
> > Application.Run(new frmSplash());
> > the way you suggest...I could be wrong...
>
> Why wouldn't it run? When frmSplash is closed, where do you think execution
> goes from there? Application.Run simply sets up a message pump on the Form
> passed in. When the form is destroyed, the pump exits, which puts execution
> back into Main.
>
> > Also, the splash page is used to setup/validate a data file, init the
> > login
> > form, and a few other things. I provide the user with information as the
> > application loads by refreshing a label after each process. With your
> > suggestion the frmLogin object is not even created yet, both forms would
> > get
> > created before I can even provide the user with update messages...
>
> Then you need an instance of it available to the splash form. Something
> like this maybe?
>
> static class Program
> {
> internal static frmLogin m_frmLogin = new frmLogin();
>
> [MTAThread]
> static void Main()
> {
> Application.Run(new frmSplash());
> Application.Run(m_frmLogin);
> }
>
> }
> }
>
> Or this:
>
> static class Program
> {
> [MTAThread]
> static void Main()
> {
> frmLogin login = new frmLogin();
> Application.Run(new frmSplash(login));
> Application.Run(login);
> }
>
> }
> }
>
> >
> > If anybody has a sample of code that will solve this riddle I would add
> > you
> > to my Christmas list...but you have to hurry cause Christmas is just
> > around
> > the corner :-)
> >
> > Again, the old way (windows CE) was to:
> >
> > Application.Run(new frmSplash());
> >
> > ...and in the frmSplash_Load event I could do everything...ie
> >
> > frmSplash.update();
> > frmSplash.Show();
> > frmLogin Login = new Login();
> > Login.Show();
> > frmSplash.Hide();
> >
> > ...it worked great!! What the heck has changed in Mobile 5.0?? Or maybe
> > all
> > the years of crack smokin is taking it's toll on me....
>
> And I maintain this is a kludge.
>
> -Chris
>
>
>

Re: Show/Hide Forms by Chris

Chris
Thu Dec 15 16:10:08 CST 2005

WM 5.0 enforces only one wceload.exe running at a time. You setup will have
to CreateProcess one, wait on the process info handle, then CreateProcess on
the next.

--
Chris Tacke
Co-founder
OpenNETCF.org
Are you using the SDF? Let's do a case study.
Email us at d c s @ o p e n n e t c f . c o m
http://www.opennetcf.org/donate


"Charcoal" <Charcoal@discussions.microsoft.com> wrote in message
news:9470A9AA-4B04-4D59-9962-537E69BC2043@microsoft.com...
> PSS. Chris, got any solutions to auto installing multiple CABs?? I'm only
> running one instance of wceload.exe. If you search this forum on
> 'wceload.exe' or 'CAB' you will see details on this issue.
>
> My setup dll is very simple and it too worked before. No such luck now and
> it's no fun having to go into the mobile and run all the supporting CABs
> after the applications initial install. Let me know if you need to see my
> CABs ini setup, inf, or the steup.dll code. It's all pretty straight
> forward
> and IT DID work. If you feel this is best resolved at a higher level let
> me
> know so I can stop buggin everybody. :-) Thanks
> --
> Charcoal
> Going Mobile...Keep me moving.
>
>
> "Chris Tacke, eMVP" wrote:
>
>> "Charcoal" <Charcoal@discussions.microsoft.com> wrote in message
>> news:BC140E5E-4216-4F4F-A6B3-55E1DF643EA6@microsoft.com...
>> > Not sure that would help. Maybe I don't understand...but,
>> > Application.Run(new frmLogin());
>> > would never run after
>> > Application.Run(new frmSplash());
>> > the way you suggest...I could be wrong...
>>
>> Why wouldn't it run? When frmSplash is closed, where do you think
>> execution
>> goes from there? Application.Run simply sets up a message pump on the
>> Form
>> passed in. When the form is destroyed, the pump exits, which puts
>> execution
>> back into Main.
>>
>> > Also, the splash page is used to setup/validate a data file, init the
>> > login
>> > form, and a few other things. I provide the user with information as
>> > the
>> > application loads by refreshing a label after each process. With your
>> > suggestion the frmLogin object is not even created yet, both forms
>> > would
>> > get
>> > created before I can even provide the user with update messages...
>>
>> Then you need an instance of it available to the splash form. Something
>> like this maybe?
>>
>> static class Program
>> {
>> internal static frmLogin m_frmLogin = new frmLogin();
>>
>> [MTAThread]
>> static void Main()
>> {
>> Application.Run(new frmSplash());
>> Application.Run(m_frmLogin);
>> }
>>
>> }
>> }
>>
>> Or this:
>>
>> static class Program
>> {
>> [MTAThread]
>> static void Main()
>> {
>> frmLogin login = new frmLogin();
>> Application.Run(new frmSplash(login));
>> Application.Run(login);
>> }
>>
>> }
>> }
>>
>> >
>> > If anybody has a sample of code that will solve this riddle I would add
>> > you
>> > to my Christmas list...but you have to hurry cause Christmas is just
>> > around
>> > the corner :-)
>> >
>> > Again, the old way (windows CE) was to:
>> >
>> > Application.Run(new frmSplash());
>> >
>> > ...and in the frmSplash_Load event I could do everything...ie
>> >
>> > frmSplash.update();
>> > frmSplash.Show();
>> > frmLogin Login = new Login();
>> > Login.Show();
>> > frmSplash.Hide();
>> >
>> > ...it worked great!! What the heck has changed in Mobile 5.0?? Or maybe
>> > all
>> > the years of crack smokin is taking it's toll on me....
>>
>> And I maintain this is a kludge.
>>
>> -Chris
>>
>>
>>



Re: Show/Hide Forms by Charcoal

Charcoal
Sun Dec 18 16:03:03 CST 2005

Great, I understand that. My process only runs one wceload and always
has...waits before running each. Now it doesn't work...are there any examples
of creating a setup dll that will run on Mobile 5.0 that you are aware of??
Thanks
--
Charcoal
Going Mobile...Keep me moving.


"Chris Tacke, eMVP" wrote:

> WM 5.0 enforces only one wceload.exe running at a time. You setup will have
> to CreateProcess one, wait on the process info handle, then CreateProcess on
> the next.
>
> --
> Chris Tacke
> Co-founder
> OpenNETCF.org
> Are you using the SDF? Let's do a case study.
> Email us at d c s @ o p e n n e t c f . c o m
> http://www.opennetcf.org/donate
>
>
> "Charcoal" <Charcoal@discussions.microsoft.com> wrote in message
> news:9470A9AA-4B04-4D59-9962-537E69BC2043@microsoft.com...
> > PSS. Chris, got any solutions to auto installing multiple CABs?? I'm only
> > running one instance of wceload.exe. If you search this forum on
> > 'wceload.exe' or 'CAB' you will see details on this issue.
> >
> > My setup dll is very simple and it too worked before. No such luck now and
> > it's no fun having to go into the mobile and run all the supporting CABs
> > after the applications initial install. Let me know if you need to see my
> > CABs ini setup, inf, or the steup.dll code. It's all pretty straight
> > forward
> > and IT DID work. If you feel this is best resolved at a higher level let
> > me
> > know so I can stop buggin everybody. :-) Thanks
> > --
> > Charcoal
> > Going Mobile...Keep me moving.
> >
> >
> > "Chris Tacke, eMVP" wrote:
> >
> >> "Charcoal" <Charcoal@discussions.microsoft.com> wrote in message
> >> news:BC140E5E-4216-4F4F-A6B3-55E1DF643EA6@microsoft.com...
> >> > Not sure that would help. Maybe I don't understand...but,
> >> > Application.Run(new frmLogin());
> >> > would never run after
> >> > Application.Run(new frmSplash());
> >> > the way you suggest...I could be wrong...
> >>
> >> Why wouldn't it run? When frmSplash is closed, where do you think
> >> execution
> >> goes from there? Application.Run simply sets up a message pump on the
> >> Form
> >> passed in. When the form is destroyed, the pump exits, which puts
> >> execution
> >> back into Main.
> >>
> >> > Also, the splash page is used to setup/validate a data file, init the
> >> > login
> >> > form, and a few other things. I provide the user with information as
> >> > the
> >> > application loads by refreshing a label after each process. With your
> >> > suggestion the frmLogin object is not even created yet, both forms
> >> > would
> >> > get
> >> > created before I can even provide the user with update messages...
> >>
> >> Then you need an instance of it available to the splash form. Something
> >> like this maybe?
> >>
> >> static class Program
> >> {
> >> internal static frmLogin m_frmLogin = new frmLogin();
> >>
> >> [MTAThread]
> >> static void Main()
> >> {
> >> Application.Run(new frmSplash());
> >> Application.Run(m_frmLogin);
> >> }
> >>
> >> }
> >> }
> >>
> >> Or this:
> >>
> >> static class Program
> >> {
> >> [MTAThread]
> >> static void Main()
> >> {
> >> frmLogin login = new frmLogin();
> >> Application.Run(new frmSplash(login));
> >> Application.Run(login);
> >> }
> >>
> >> }
> >> }
> >>
> >> >
> >> > If anybody has a sample of code that will solve this riddle I would add
> >> > you
> >> > to my Christmas list...but you have to hurry cause Christmas is just
> >> > around
> >> > the corner :-)
> >> >
> >> > Again, the old way (windows CE) was to:
> >> >
> >> > Application.Run(new frmSplash());
> >> >
> >> > ...and in the frmSplash_Load event I could do everything...ie
> >> >
> >> > frmSplash.update();
> >> > frmSplash.Show();
> >> > frmLogin Login = new Login();
> >> > Login.Show();
> >> > frmSplash.Hide();
> >> >
> >> > ...it worked great!! What the heck has changed in Mobile 5.0?? Or maybe
> >> > all
> >> > the years of crack smokin is taking it's toll on me....
> >>
> >> And I maintain this is a kludge.
> >>
> >> -Chris
> >>
> >>
> >>
>
>
>