07-26-2019 06:49 AM
Hi guys
I have been working on an application having multiple tabs form tab control.
I am trying to give specific number (say 1 ) to the specific tab so that i can change pages of tab control with numeric keys(1 for first page, 2 for second page and so on)
can anybody help me with this
Thanks and Regards
Solved! Go to Solution.
07-26-2019 07:34 AM
Use an event structure with a key down or key up event that acts on behalf of the VI.
I think this might be a very dangerous user interface. The only way it makes sense is if you will never have any string controls or especially numeric controls that you would ever have to type those numbers into. You might want to consider using a combination of a number and a modifier key like Alt or Control. The Key Down or UP event would have a case structure that would only do it's action if it also detects a Ctrl or Alt key had been pressed as well.
07-26-2019 11:50 AM
Function keys for the tabs is also an option (assuming you are not using them for something else)
07-29-2019 01:51 AM
Thank you for your help. But i want that tabs to be controlled with mouse and also with the specific key. And yes i dont have such controls so these specific keys wont be get typed in it.
I tried with event structure Key up and key down but these are not for specific key and respond to any key pressed.
I also tried Case structure with Key character constants from event structure and this way it is only working with the key but not with the mouse.
I required is simple. When there is a application with multiple tabs say upto 5 then it should be working with mouse(for example clicking any tab and pressing ok, cancel buttons in that tab) as well as with the specific key for each tab(the tab will be selected when i press 1 and then again i can use the options like ok and cancel)
07-29-2019 01:52 AM
@Frozen Member
I didn't get this. Can you explain or show a SS of it please
07-29-2019 02:05 AM
Hi mabaig,
I tried with event structure Key up and key down but these are not for specific key and respond to any key pressed.
You need to filter/look for the right key…
I also tried Case structure with Key character constants from event structure and this way it is only working with the key but not with the mouse.
An event set to wait for key events will not react on mouse events.
Have you tried to catch the correct mouse events?
What have you tried? Mind to attach your current VI state?
07-29-2019 03:02 AM
HI GredW,
You need to filter/look for the right key…
In the event structure there is no option for specific key. It has only key up , key down and so on & also it cant be controlled like we control tabs without any event(default) with mouse.
Thanks & Regards
07-29-2019 03:18 AM
07-29-2019 03:21 AM
Each event features specific input Data Fields. For a Key Up event, ScanCode carries information about wich physical key you pressed, see below form the LabVIEW Help (2017). Mods and PlatMods fields can also be useful.
Requires: Base Development System
Class: Control Events
Type: Notify
Generated when the user releases a key on the keyboard in a specific control on the front panel.
![]() |
Note LabVIEW only generates events for the Cluster»All Elements source when the cluster has keyboard focus, not when an individual element inside the cluster has keyboard focus. |
Name | Description | ||
---|---|---|---|
Source | Source of the event. LabVIEW UI refers to any built-in user interface event.
|
||
Time | Value of the millisecond timer when the event occurred. | ||
Time | Value of the millisecond timer when the event occurred. | ||
ScanCode | Scan code unique for each key on the keyboard. The values are unique for each physical key, and allow you to match Key Up and Key Down events. | ||
Mods | Cluster of Booleans that contain platform-independent modifiers. LabVIEW returns all platform-dependent modifiers in the PlatMods event data field. For key events, this event returns a Boolean indicating if the event occurred on the numeric keypad. For mouse events, this event returns a Boolean indicating if the event was a double-click. For both events, a Boolean is returned if the platform-independent menu key, such as <Ctrl> on Windows or <Command> on Mac OS X, was pressed when the event occurred. For filter events, you can modify the data returned by this event data field. | ||
PlatMods | Cluster of Booleans that contain platform-dependent modifiers. Specifies if platform-dependent keys, such as <Ctrl>, <Shift>, <Alt>, <Command>, and <Option> were held down when the event was triggered. For filter events, you can modify the data returned by this event data field. A key can be both a Mod and PlatMod. For example, <Ctrl> is the platform-independent menu key on Windows, but you also can use it in platform-dependent programming. | ||
FocusObj | A reference to the object that has keyboard focus. When the event is for a control, it might be a sub-component, like a scale, label, and so on, rather than the control itself. You also can modify the data returned by this event data field. |
08-01-2019 03:31 AM
Thank You so much everyone for the help and all of your responses were worthy and appreciated.
I have achieved what i was looking for by simply putting case structure inside the event structure as conditions of ScanVal from key down? event and in case structure selected the key values that i needed.
You guys are wonderful.
Thanks and Regards
Baig