Jump to content

Programmatically showing tip strips


Recommended Posts

Hi all,

I have been following this forum for quite some time now. This is my first post though.

I have a front panel with some string controls. I would like to restrict the user from entering some special characters in them. I would like to know if I can display him the tip strip programmatically whenever a special character is entered. I can show him a dialog box but its really annoying.

I have seen a similiar behavior in Windows Explorer. I have attached a snapshot of the same to let you guys know what I am referring to. The picture shows balloons not tool strips I could do with those too.

It would be great if I get some help on this.

Justin

post-4372-1148982629.jpg?width=400

Link to comment

You can use a string indicator, which is usually hidden. If the user enters an illegal character, make this indicator visible and display the error message.

To show the user which one is the offensive character, you can use the text.selection property on your string control to highlight it. The string control has to be in key focus for the highlighting to work.

Good luck!

Guenther

Link to comment
You can use a string indicator, which is usually hidden. If the user enters an illegal character, make this indicator visible and display the error message.

To show the user which one is the offensive character, you can use the text.selection property on your string control to highlight it. The string control has to be in key focus for the highlighting to work.

Good luck!

Guenther

Thats a neat way to do it. But I have around 10 to 12 of these string controls on my panel and it would be a lot of objects on the front panel if I keep an indicator for each to display the error message.

Justin

Link to comment
...I have around 10 to 12 of these string controls on my panel...

Use the event structure creativly - have a case that looks for a key down in all of the string controls, then the event case will return a control reference (through a node on the left of the structure) - pipe that into a property node and get the string out of the control and then use the above method from there...

Link to comment
Thats a neat way to do it. But I have around 10 to 12 of these string controls on my panel and it would be a lot of objects on the front panel if I keep an indicator for each to display the error message.

Justin

You shouldn't have to keep one error display per entry control, you should just need one error display string control for the whole front panel. You'll just have to change the position to the appropriate position for each control you want to display the error for. Monitor each of these controls in an event structure and search for any offending characters upon value change events and you should be set.

:thumbup:

Link to comment
Hi all,

I have been following this forum for quite some time now. This is my first post though.

I have a front panel with some string controls. I would like to restrict the user from entering some special characters in them. I would like to know if I can display him the tip strip programmatically whenever a special character is entered. I can show him a dialog box but its really annoying.

Justin

Hi Justin,

Use the event structure to find when a control is being updated, check the input string and then write your warning message to the property node>tip strip of the control.

Keep checking with the event structure, to clear the tip strip (write an empty string to the tip strip property) when the user adjusts the input again.

You know, this is the perfect use-case to implement an X-Control! then just propagate your X-control for the number of string controls you have on your panel.

Neville.

Link to comment

Here's a VI that does what I was tlaking about. That said, I don't think the tipstrip is what you're after, because you can't dynamically force it to pop up - the position and tracking of the mouse relative to the control does that for you... You might need to stick to a dialog box, or maybe create a dedicated VI that pops up next to your control (set its' window behaviour to "floating") - you can get the co-ordinates of the control as a property (just like the attached VI gets the text).

Download File:post-181-1149006053.vi

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
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.