LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Tab control page change

Solved!
Go to solution
Highlighted

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

0 Kudos
Message 1 of 20
(382 Views)

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.

0 Kudos
Message 2 of 20
(356 Views)

Function keys for the tabs is also an option (assuming you are not using them for something else)

0 Kudos
Message 3 of 20
(316 Views)

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)

 

0 Kudos
Message 4 of 20
(265 Views)

@Frozen Member 

I didn't get this. Can you explain or show a SS of it please

0 Kudos
Message 5 of 20
(263 Views)

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?

Best regards,
GerdW
CLAD expired, using LV2011SP1 + LV2017 (+LV2019 sometimes) on Win7+cRIO
Kudos are welcome Smiley Wink

0 Kudos
Message 6 of 20
(255 Views)

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

0 Kudos
Message 7 of 20
(241 Views)
Solution
Accepted by topic author mabaig

Hi mabaig,

 

in the event case you also can read which key was pressed: use a case structure/comparison inside the event case…

Best regards,
GerdW
CLAD expired, using LV2011SP1 + LV2017 (+LV2019 sometimes) on Win7+cRIO
Kudos are welcome Smiley Wink

Message 8 of 20
(231 Views)
Solution
Accepted by topic author mabaig

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.

 

Key Up Event

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.

Event Data Fields

Name Description
Source Source of the event. LabVIEW UI refers to any built-in user interface event.

0 LabVIEW UI
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.

Paolo
-------------------
LV 7.1, 2011, 2017, 2019
Message 9 of 20
(229 Views)

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

 

0 Kudos
Message 10 of 20
(202 Views)