Setting DialogResult in OnClosing

G

Guest

In all the documentation on DialogResults it says that you can override the
DialogResult in the OnClosing event. I am working in VB and I just cannot do
this. I call ShowDialog with an OK in the top right. The form always returns
an OK whatever I do in the OnClose.
Is this an undocumented difference between CF and the desktop.
 
D

Daniel Moth

Can you show the code? This works for me fine
VS2005, CF v2, VB PPC2003 project. In the OnClosing event of the second form
that I show with ShowDialog I have this line of code
Me.DialogResult = Windows.Forms.DialogResult.XXX 'XX = your choice

The calling code in form1 correctly gets the result I expect.

Cheers
Daniel
 
D

Dinesh Bajaj

In a CF application, if a form is shown with ShowDialog command, and
then dismissed by tapping on the OK button in the title bar, will
always return the DialogResult property value to be DialogResult.OK,
irrespective of the DialogResult value set in the Closing
event-handler.

This indeed is an behavioral difference between the CF and the full
Framework.
 
D

Dinesh Bajaj

I noticed v2, but was under the assumption that v2 works only with
WM5 devices. I just discovered that it also supports PPC2003 devices.
So, thanks Daniel for pointing out v2 thing to me. :)
 
G

Guest

Thanks guys

Dinesh Bajaj said:
I noticed v2, but was under the assumption that v2 works only with
WM5 devices. I just discovered that it also supports PPC2003 devices.
So, thanks Daniel for pointing out v2 thing to me. :)
 

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