forms programming qns

  • Thread starter Thread starter cody
  • Start date Start date
C

cody

You could get the value of the SelectionStart-property and determine how
many \r\n are before that position in the text. I cannot imaginge another
solution.
 
Hi,
how do I get the line number the cursor(the one blinking) is at in a
multiline textbox?

Thanks
 
http://www.vb-helper.com/howto_track_textbox_caret.html


--
Bob Powell [MVP]
Visual C#, System.Drawing

Image transition effects, automatic persistent configuration and
design time mouse operations all in April's issue of Well Formed
http://www.bobpowell.net/wellformed.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/gdiplus_faq.htm

The GDI+ FAQ RSS feed: http://www.bobpowell.net/faqfeed.xml
Windows Forms Tips and Tricks RSS: http://www.bobpowell.net/tipstricks.xml
Bob's Blog: http://royo.is-a-geek.com/siteFeeder/GetFeed.aspx?FeedId=41
 
Hello,
You can't directly get the line number. You can directly get the character
number through (textBox1.SelectionStart).
Then after that, you can do calculations to divide this number by the
length of the strings in the collection.
Hope this helped.

Regards,
Rami Saad
MEA Developer Support Center
ITworx on behalf of Microsoft EMEA GTSC
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top