Strange Problem with ShowDialog function

S

Sreedharan

Mine is a WinCE3.0 device.
When deploying application from Visual Studio .NET, I am selecting
"Pocket PC device" as the targwet device.

I found by using the steps mentioned below, ShowDialog isn't working
properly(It will still show the new form, but it won't be a modal
dialog). How ever this scenario didn't occur in Emulator

1) Create a new Smart device Project
2)Let the class name be Form1.Place 2 buttons controls namely
"Show","Close" in the Form1.

3)On the button click event place the following code,

private void CloseButton_Click(object sender, System.EventArgs e)
{
Close();
}

private void ShowButton_Click(object sender, System.EventArgs e)
{
Form1 frm = new Form1();
frm.ShowDialog();
}

4) Run the application in the device. Click the "Show" button, It will
pop-up another form. Click the Show button in the second form. 3rd
form will be shown. Now Click "Show" button in the 3rd form. another
form will be shown.

5) I notice that, user can still activate 3rd form when 4th form is
being shown. (this should not happen, for ShowDialog() )

How to resolve it?


Regards,
Sreedharan
 
F

fd123456

Hi Sreedharan,
4) Run the application in the device. Click the "Show" button, It will
pop-up another form. Click the Show button in the second form. 3rd
form will be shown. Now Click "Show" button in the 3rd form. another
form will be shown.

Up till now, everything behaves as expected, am I correct?
5) I notice that, user can still activate 3rd form when 4th form is
being shown. (this should not happen, for ShowDialog() )

Exactly how do you activate form3 from form4? Do you mean that form4
is not modal? Is form3 still visible somehow?


Michel
 
S

Sreedharan

Hello Mr.Michel,
Thanks for your reply!!
Yes, Upto Step-4 everything behaves as expected.

During design,I set the Form size to smaller size. After the Form4 has
been activated, i can drag & move the Form4 so that form3 can be seen.
Then i can able to interact with form3.


(Basically, I have only one form(ie, Form1) When clicking the button
in the Form1, It will create another instance of Form1 using
ShowDialog Function.)


Regards,
Sreedharan
 
F

fd123456

Hi Sreedharan,

I cannot reproduce the behaviour you are describing. When I show a
form, whatever it's settings are (Minimize box, Control Box, Window
State), with or without a menu, with or without a toolbar, and
whatever the way I show it:

Form f = new Form1(), or
Form1 f = new Form1();

f.Show(), or
f.ShowDialog();

....it is always full screen, I cannot resize it (even with "f.Size =
new Size(100,100);").

Are you working in VB or C#? Do you have a Main entry point, i.e.:

Application.Run(new Form1());

....? On which device are you doing your tests? Which version of the CF
are you using?

HTH,

Michel
 
S

Sreedharan

Michel,
My device isn't a pocket PC. It is a WinCE3.0 (MIPS).
I am using C#.
I don't know where to find CF version. My Visual Studio .NET 2003
version is 7.1.3088.

Thank you,

Regards,
Sreedharan
 
P

Paul G. Tobey [eMVP]

Just a note: Windows CE 3.0-based devices, other than PPC devices, are not
supported by the .NET CF.

Paul T.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top