I have an updatable dashboard that allows creating a label based on info on the order line (P/N, Order Num, Cust PO#, etc…). The text created is placed into a textbox, for any cleanup or tweaking before saving.
When the textbox does not have focus, the text appears fine. In the following, I clicked in the Read Only field of the Part Description (1), and the Prod Label text box(2) looks fine.
I use the “\n” for making multi-line text string, like:
Desc = Desc + “\nActive Length: " + temp + " FT”;
Some of the textbox’s properties:
Multiline: TRUE
WordWrap: TRUE
ScrollBars: BOTH
EpiBinding: V_CK_Prod_Label_ML_1View.OrderDtl_ProdLabel_c
If I copy the text (when it looks like the 2nd pict above), and view with a Clipboard viewer, it shows the LF (0x0A) charcter is in the text.
If I place the cursor in the Prod Label Text box and hit the Enter key on my keyboard, then copy the text, the clipboard viewer shows a CR(0x0D) and a LF(0x0A) are inserted - instead of just a LF(0x0A).
Should my code that builds the text use \r\n instead?
Any other “constants” I should use? Is Environment.Tab
valid?
And every now and then a data filed ends up with a RS (hex 0x1E), a Record Seperator? in it. Exports that have the RS embedded in a field’s data, tend to get split when imported into programs like Excel. Any idea where they come from?
Is a cast (char)10 and (char)13
However replacing both of those is going to give you double breaks.
if you replace (char)10 with NewLine and (char)13 also with new line you’ll end up with 2 line breaks.
Thank you! This compiles much better! Maybe I am on the wrong thread, but I am trying to have my text box show the line breaks when in edit mode. The problem is the user sees the line breaks, then clicks in the textbox and they all collapse into zero width characters.
Is there a way to show line breaks in a textbox in edit mode?
If you select those two lines in Notepad++, and paste them into the field, it shows as two lines. But as soon as you leave that field, the linebreak collapses?
This is interesting! If I copy and paste my comment text into n++, then copy and paste back out, the line breaks stay perfectly, even in edit mode! How can I reproduce this in code, so that my comment field automatically updates when I click in to edit it?
I have tried placing this bit of code into the comment box’s AfterEnterEditMode, BeforeEnterEditMode, GotFocus, and Enter events. (I understand this make double line breaks, but I can’t get it to do anything.)