Selection Control??
-
Ok, let's say I have a textbox called 'txtbox1'. I limit its maxlength to 6. I put in its text content to be '123456' Now, the thing is, when I run this form, the program will automatically hightlight selection all '123456'. Is it possible for me to add some code to control that selection? Example, instead of it highlight selecting all '123456' , can i put in a code to make it only highlight select '234' whenever I load the form? Or better yet, can I even disable this highlight selection?
-
Ok, let's say I have a textbox called 'txtbox1'. I limit its maxlength to 6. I put in its text content to be '123456' Now, the thing is, when I run this form, the program will automatically hightlight selection all '123456'. Is it possible for me to add some code to control that selection? Example, instead of it highlight selecting all '123456' , can i put in a code to make it only highlight select '234' whenever I load the form? Or better yet, can I even disable this highlight selection?
The textbox has 2 important properties to control text selection : SelectionStart SelectionLength Start indicates the start position of your selection Length indicates the length of the selection Automaticly when a textbox gets focused, the SelectionStart is set to 0 en the selection length depends on the textlength. Handle the OnGotFocus event and set the SelectionStart en SelectionLength properties to your desired values and your problem should be solved...
I love it when a plan comes together
-
The textbox has 2 important properties to control text selection : SelectionStart SelectionLength Start indicates the start position of your selection Length indicates the length of the selection Automaticly when a textbox gets focused, the SelectionStart is set to 0 en the selection length depends on the textlength. Handle the OnGotFocus event and set the SelectionStart en SelectionLength properties to your desired values and your problem should be solved...
I love it when a plan comes together