Click here to Skip to main content
15,888,527 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
when line is inserted after button click the cursor does not get pointed on the new line


so,can i get some help for resolving my issue?

What I have tried:

RichTextBox1.Text = RichTextBox1.Text.Insert(RichTextBox1.SelectionStart, Environment.NewLine)
Posted
Updated 11-Jun-19 23:48pm
v2

1 solution

Same issue as your other question: https://www.codeproject.com/Questions/5099718/Save-error-in-richtextbox-in-VB-NET[^]. Please see the documentation for the RichTextBox.
 
Share this answer
 
Comments
shaileshshinde 12-Jun-19 7:36am    
means? i am not able to understand.

can i get the code?
Richard MacCutchan 12-Jun-19 7:39am    
What code? We have no idea what your code is doing or what does not work. Have you checked the documentation to see what happens when you add text in whatever your application does?
shaileshshinde 12-Jun-19 7:44am    
in richtextbox using below code:
RichTextBox1.Text = RichTextBox1.Text.Insert(RichTextBox1.SelectionStart, Environment.NewLine)

i have added new blank line.but what i want is after adding new blank line the cursor should get pointed to blank line.but in my case the cursor does not get pointed on that blank line
Richard MacCutchan 12-Jun-19 8:00am    
Probably because the focus is still on the button. Call the Focus method on the RichTextBox.
shaileshshinde 13-Jun-19 5:51am    
@Richard focus goes to the first line of richtextbox.

i need focus to be on the newline added after executing the code.

is their any solution for that?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900