09-25-2013 05:23 AM
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
09-25-2013 06:11 AM
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
09-26-2013 05:15 AM
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
09-26-2013 06:05 AM
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
09-26-2013 06:30 AM - edited 09-26-2013 06:31 AM
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.
09-26-2013 08:43 AM
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
09-26-2013 09:28 AM
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
09-26-2013 10:58 PM
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