Can anyone advise me how to add an About form to my app.
I have tried to do it, and it works well on my Desktop, but
on my pocket pc it is doing some problems, for example,
after I display the About form with ShowDialog, and then
hide the dialog, I cannot access controls on the main form,
and also I cannot stop the app from Tasks. Any ideas?

Also, does anyone know how to create a global variable that
I can access from all forms, before I even instantiate the form.

For example, from the About form, I want to set a variable
on Form1 (the main form), but only constance come up on
the intellisense. The only way I can think of is doing it the
other way round, and having my global var on the About form
rather than on Form1, and then in Form1 I can instantiate the
About form and then I can access the global in About.
Is there no other way, without instantiation?

tia.

Re: Question about a dialog form by jp2code

jp2code
Mon Aug 13 15:28:35 CDT 2007

Hey Jamis,

There should be a default About form whenever you create a blank Dialog
Form. Did this show up for you?

As for global variables, the accepted method would be to add public
properties to your About Form (or whatever form you want to show), then
after the form has closed, you get the values from it.

Personally, I go with a global file and a global header. Everything is
defined in the global file and referenced in the global header as an extern.
For example:
global.h:
extern LPCTSTR g_STOP_NOW;

global.cpp
#include global.h
LPCTSTR g_STOP_NOW = TEXT("Stop now, you fool!");

Then, from within any file you want to access that from, just remember to
include your global header file.

Make sense?

<Jamis> wrote:
> Can anyone advise me how to add an About form to my app.
> I have tried to do it, and it works well on my Desktop, but
> on my pocket pc it is doing some problems, for example,
> after I display the About form with ShowDialog, and then
> hide the dialog, I cannot access controls on the main form,
> and also I cannot stop the app from Tasks. Any ideas?
>
> Also, does anyone know how to create a global variable that
> I can access from all forms, before I even instantiate the form.
>
> For example, from the About form, I want to set a variable
> on Form1 (the main form), but only constance come up on
> the intellisense. The only way I can think of is doing it the
> other way round, and having my global var on the About form
> rather than on Form1, and then in Form1 I can instantiate the
> About form and then I can access the global in About.
> Is there no other way, without instantiation?
>
> tia.
>
>



Re: Question about a dialog form by Jamis>

Jamis>
Mon Aug 13 17:05:01 CDT 2007

> Hey Jamis,
>
> There should be a default About form whenever you create a blank Dialog
> Form. Did this show up for you?

No, the only UI is a Windows Form. I am using VB and VS2003

>
> As for global variables, the accepted method would be to add public
> properties to your About Form (or whatever form you want to show), then
> after the form has closed, you get the values from it.

Can I ask you, after I finish to use the dialog, do I call Hide() or
Close().
It's working fine now, thanks.
BTW, I am unable to find the keyboard button at the bottom of the
screen when the dialog window is displayed, Any ideas?