Jump to content

Focus Lost / Focus Gained events


eaolson

Recommended Posts

It would be nice to have Focus Gained and Focus Lost events for front panel objects. I was writing a simple application with a string control that I wanted to always have focus, so the user could just type and not have to worry about whether the cursor was actually in the string control. It's easy enough to give the control focus with the KeyFocus property, but if the user interacts with another control (e.g. a button) the string loses focus. In my event structures, I have to create dummy ValueChanged events in case the user interacts with a control.

Link to comment

This idea might or might not be good (I can't say I really thought about it), but in any case, you have some better options for implementing your example. The Value Change event doesn't really help you, since it doesn't cover cases where users clicked outside the controls or outside the window. You could handle each of those as well (and handle all controls together by using dynamic events), but one easier solution would be to do this:

post-1431-1220607045.png?width=400

Personally, I can can't think of many VIs in which I would want something like this, but I suppose you might want this in some VIs.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.