Answered by:
Status Strip - RTF Location

Question
-
Hi All,
Would like to know, what is the code for status strip text location.
I am developing an advanced notepad for some customizing text etc. and cannot find code or examples anywhere of how to put a text label in the status strip for the text "Column" & "Row" location.
Its basically the same as the windows notepad feature.
Can anyone please help me with this.
Thank You.
Friday, March 10, 2006 7:39 AM
Answers
-
but about which line and which column i don't know anyway to do that http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=291492&SiteID=1
Dim Ln As Integer = Me.RichTextBox1.GetLineFromCharIndex(Me.RichTextBox1.SelectionStart)Dim Cn As Integer = (Me.RichTextBox1.SelectionStart) - (Me.RichTextBox1.GetFirstCharIndexFromLine(Ln))
Dim MyString As String = "Line: " & Ln.ToString & " Col: " & Cn.ToString
Friday, March 10, 2006 6:17 PM
All replies
-
You must first add a toolstripstatuslabel to the status strip...
Me
.ToolStripStatusLabel1.Text = ("MyString")If you are using an rtf box for your notepad then the richtextbox control has methods to return the current line and character position.
Friday, March 10, 2006 1:56 PM -
hi,
you can add panels to your status strip to give you the same look as what you talk about , but about which line and which column i don't know anyway to do that , i guess you may get the curser coordinates and store in those panels
best regards
Friday, March 10, 2006 6:12 PM -
but about which line and which column i don't know anyway to do that http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=291492&SiteID=1
Dim Ln As Integer = Me.RichTextBox1.GetLineFromCharIndex(Me.RichTextBox1.SelectionStart)Dim Cn As Integer = (Me.RichTextBox1.SelectionStart) - (Me.RichTextBox1.GetFirstCharIndexFromLine(Ln))
Dim MyString As String = "Line: " & Ln.ToString & " Col: " & Cn.ToString
Friday, March 10, 2006 6:17 PM -
thx Man for enlighten meFriday, March 10, 2006 6:38 PM
-
Thank You.
Will try this and see what happens. Should work.
Friday, March 10, 2006 6:44 PM