LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

String controller help with showing English and Chinese without spacing

Solved!
Go to solution

I'm having issues with unicode in labview with string controllers.

I want to be able to type english and chinese together in a single control and being able to backspace.

ex)

ricky48_9-1628220096652.png

However when I'm using Force Unicode Text, the english letter became represented as UTF16LE and requires me to backspace twice to delete a single letter. If i only delete once, it screws up the whole input.

ricky48_5-1628219619799.png

 ex) deleting the space between a and s

ricky48_6-1628219644870.png would  return ricky48_10-1628220553805.png ???

 

I've found that I could use Update Value While Typing with NI Update String in the Value Changed Event 

ricky48_7-1628219746717.png

This lets me input/backspace properly, but it also caused more bugs with the font size resizing and becoming double lined when entering long strings.

As well as scrambled overlapped characters and the display remains on the first line eventho multiple lines were entered.

ricky48_8-1628219898940.png

 

 

Currently I have set the following 

ricky48_1-1628219192596.png

Event: SControl -> Mouse Down

ricky48_4-1628219327628.png

 

 

 

Can anyone help? 

 

0 Kudos
Message 1 of 8
(1,688 Views)

bump

0 Kudos
Message 2 of 8
(1,634 Views)

I had similar problem 2 years ago when creating a GUI for a customer's Russia branch.

I can't make a unicode string input work for both cases.

Maybe you can try to use 2 string inputs, one for ASCII, another for Chinese.

Let user choose which language he wants.  then you can show/hide string controls.

 

George Zou
0 Kudos
Message 3 of 8
(1,615 Views)

Yeah that sounds ok, but my client wants chinese/english mixed in without having a set structure as to which language goes where in the string.

 

The force unicode seems to create so many bugs, from cursor position, overlapping text, font resizing and etc.

 

This is really frustrating with how something that is so basic is not supported nor is there any solution to it...

 

 

0 Kudos
Message 4 of 8
(1,596 Views)

but my client wants chinese/english mixed in without having a set structure as to which language goes where in the string.

 

How about a .Net Textbox?

 

George Zou
0 Kudos
Message 5 of 8
(1,591 Views)

Do you have any example vi of how to use/set a .Net Textbox to take chinese and english charc?

Haven't used .net with labview before and I can't seem to set the font to the textbox property.

Thanks

0 Kudos
Message 6 of 8
(1,585 Views)
Solution
Accepted by topic author ricky48

Just drop a RichTextBox on the FP.  It's a ctrl, user type Chinese or English in the box.  Just like a string control, no code needed for input.

 

You can use a property node to read the user input.

 

George Zou
Message 7 of 8
(1,566 Views)

Ok thnx, using a .net rich text box fixed all my issues with displaying in a text control.

0 Kudos
Message 8 of 8
(1,550 Views)