jeudi 13 avril 2017

Disable a button control (attached context menu) , when lost focus from a text box -

I got into a design issue, in my project.

What I have on my Window/dialog/widget?:

I have a Text Box A and Button B.

And, there are some more controls C, D, E, F.

And Button B, click action handles a specific business.

The Button B click opens a context menu attached to button as shown in below image.

enter image description here

The Requirement?:

The Button B should be enabled and allow click operation on any item, only when Text Box A has focus.

The Button B should be disabled, when controls C, D, E, F has focus.

What we have done?:

We handled, Focus In and Focus Out events/signals/messages of Text Box A, to enable/disable Button B. Enabling Button B, in Focus In. Disabling Button B, in Focus Out.

Problem?:

The Button B enable/disable works fine. But we are unable to use the Button B context menu items, as when we click on Button B, the focus is moving out of Text Box A and the button gets disabled.

Is there any good design for handling this type of situation?

Aucun commentaire:

Enregistrer un commentaire