Hi there,

Is there a general approach for preventing users from selecting a menu item
in an SDI or MDI application whenever the current field on your form is
invalid (assuuming the app consists of a data entry form). In my case, I'm
working with a "DataGridView" which occupies the entire child window of an
MDI app but the problem likely applies to any control. If you've entered
invalid data into a "TextBox" field of a form for instance (in my case a
grid cell), it's likely that most if not all items in your menus as well as
most hotkeys should be off-limits until the user corrects the field. Without
taking great pain to prevent users from gaining access to these items
however (it's not always trivial), is there an easier approach. Thanks.

Re: Opinion wanted by justin

justin
Fri Mar 02 19:32:58 CST 2007

On Mar 2, 6:23 pm, "Jack White" <no_spam@_nospam.com> wrote:
> Hi there,
>
> Is there a general approach for preventing users from selecting a menu item
> in an SDI or MDI application whenever the current field on your form is
> invalid (assuuming the app consists of a data entry form). In my case, I'm
> working with a "DataGridView" which occupies the entire child window of an
> MDI app but the problem likely applies to any control. If you've entered
> invalid data into a "TextBox" field of a form for instance (in my case a
> grid cell), it's likely that most if not all items in your menus as well as
> most hotkeys should be off-limits until the user corrects the field. Without
> taking great pain to prevent users from gaining access to these items
> however (it's not always trivial), is there an easier approach. Thanks.

Jack:

Are you asking how to validate the users data, or how to act once
validation has been processed?


Re: Opinion wanted by Jack

Jack
Fri Mar 02 19:59:14 CST 2007

> Jack:
>
> Are you asking how to validate the users data, or how to act once
> validation has been processed?

I'm really asking if there's a mainstream way to prevent users from
selecting menu items or activating hot keys when they try to leave a control
that currently has invalid data in it. Relying on the "Control.Validating"
event for instance works fine for other controls (preventing the user from
selecting them) but it doesn't prevent users from selecting a menu item.
Most menu items however (and hot keys) are probably invalid at this stage as
well (just like other controls) but the user can click them anyway. The
plumbing involved to manually prevent it is often non-trivial and
inconsistent with the "Control.Validating" model. I'm wondering how others
handle this. Thanks for the feedback.



Re: Opinion wanted by Mark

Mark
Tue Mar 06 18:28:05 CST 2007

"Jack White" <no_spam@_nospam.com> wrote in message
news:OcU%23RHSXHHA.4964@TK2MSFTNGP06.phx.gbl...
>
> Is there a general approach for preventing users from selecting a menu
> item in an SDI or MDI application whenever the current field on your form
> is invalid

1) Please use a meaningful subject line.

2) Please do not spam multiple groups.

3) Please do not post non-C# messages to a C# newsgroup.

Thanks,

///ark