LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

keystrokes in .net control

Hi,

 

I am using a .net control in my application. The .net control is loaded with a custom made .net control, in which I have a test box. So, I press tab when .net control isin focus, the focus goes to the next control in the VI, instead I want 4-space character tobe appended in the .net control's text box.

 

Any help is appreciated.

 

Thanks and regards,

Yogesh

0 Kudos
Message 1 of 8
(3,307 Views)

Yogesh,

 

without seeing the code you are working with, all we can do is guessing.

My guess is that the keyfocus is still on the VI itself when you press the tab-key.

That will naturally lead LV to handle the tab-event, which will proceed to the next item in the "tab order", so it will (most likely) highlight another control.

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 8
(3,294 Views)

Hi,

 

Thank you Norbert. I have the access to the .NET control code. I am not handling the key stroke event explicitly in the .NET code, since its a text box.

How can I say LV to negelect the tab key event when the .NET control is in focus?

 

 

Any help is apperiated,

 

Thanks,Yogesh

0 Kudos
Message 3 of 8
(3,271 Views)

Yogesh,

 

you can capture the tab-key event in LV and discard it. The problem i see with that is that the .NET control does not get the event either in this case, so there is no chance that the text box inserts a tab.

Is this text box a standard .NET control (System.Windows.Forms)?

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 4 of 8
(3,265 Views)

Yogesh,

 

if we are indeed talking about the System.Forms.TextBox, you have to configure the element to

- Multiline TRUE (Default false)

- AcceptsTab TRUE (Default false)

 

If not both properties are set like that, pressing <tab> in the control will switch to another control (tab-order) or simply "do nothing".

 

Norbert

 

EDIT: Review the MSDN webpage for this.

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 5 of 8
(3,259 Views)

Norbert,

 

I am using a tab control, and in this I will add the FastColorText box. So essentially, its not a default text box.

I donot have any control on this FastcoloredText box (FastColoredTextBox.dll, v2.0.50727).

 

 

Thanks and regards,

 

Yogesh

 

 

0 Kudos
Message 6 of 8
(3,250 Views)

Yogesh,

 

the FastcoloredTextBox is obviously no System.Forms element.

As it is additionally encapsulated in your .NET control, i am not sure if this control even gets any information about the event "<tab> pressed".

I did a very fundamental search on this but haven't found any options like the ones i stated for the System.Forms.TextBox.

 

So maybe you want to dig into that on your own: Does the FastcoloredTextBox provide options for enabling/disabling detection of <tab>?

Also you might want to include an event callback for <tab> in your .NET control which passes this event from the contrainer down to the FastcoloredTextBox.

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 7 of 8
(3,247 Views)

Hi Norbert,

I think wat you say is correct. The FastcoloredTesxtBox donot have any such public property to access. I need to handle these button events within the DLL explicitly.

 

Thanks and regards,

Yogesh

0 Kudos
Message 8 of 8
(3,232 Views)