I've created a Text box using default settings. The code for getting the text is...
string connCodeUDL1 = "";
beam1.GetUserProperty("CONN_CODE_UDL1", ref connCodeUDL1);
textBoxConnCode1.SelectedText = connCodeUDL1;
The textbox is 10 characters long. My problem is when the connCodeUDL1 string is over 10 characters long, say 15. It displays the furthest right characters only (I can mouse drag to see the first 5 chars). I want it show the first 10 characters of the string always.
Any help would be appreciated.
Text box alignment with long string
Started by Peckerfish, May 06 2009 07:19 PM
3 replies to this topic
#1
Posted 06 May 2009 - 07:19 PM
|
|
|
#2
Posted 07 May 2009 - 08:39 AM
Please use CODE tags.
To achieve this, simply use code to set the TextBox's SelectionStart property to 0, and call ScrollToCaret():
To achieve this, simply use code to set the TextBox's SelectionStart property to 0, and call ScrollToCaret():
textBoxConnCode1.SelectionStart = 0; textBoxConnCode1.ScrollToCaret();
#3
Posted 07 May 2009 - 05:06 PM
Thank you Xav that worked well :)


Sign In
Create Account

Back to top









