07-04-2011, 01:32 AM
I renamed the application, since someone from SevenForums though the old one was silly... (Namely the admin that had the audacity to ban me without reason).
I got a line display, but it still has a few bugs to work out. I might have to use multithreading to display the numbers as it's a little slow with a lot of numbers. Word wrap on, makes the display go away (because word wrap doesn't have accurate line count). You'd need a more advanced line display like Notepad++...
So far the selected index of the listbox i'm using for the line display is a little off when you hold down the enter/return button to get a lot of line numbers on the left, it can be fixed by going back to the top and moving down, but it changes the index and is in sync with mouse clicks on the rtb control, as well as the up and down arrows
Bugs I know about so far:
-mouse scroll doesn't scroll for the line display view, only with word wrap on where the line display is hidden from view
-app lags a bit with large line counts while line display is showing
-horizontal scrollbar while line display is visible only shows when the scrollbar position is scrolled all the way down, I need to find a way to override the controls position for the scrollbar
-the selected line index on the left (highlight) is "off" by a bit sometimes
Other than that if I had those things fixed everything is good to go. I got the line display synced from switching between word wrap on and off though.
Preview:
I originally started out with a code like this for the line numbers:
That was all fine, but I didn't have a way to remove numbers based on how many line chars were removed. I had planned out another method that would count the lines on textchange, but then I realized that it would be too slow because having around 1000 lines, it would have to recount all 1000 before moving to the display for 1001. This is definitely not an easy task for a line display, i've tried all kinds of methods from different snippets created by myself, but nothing seemed to work 100% without at least one flaw.
Download:
http://www.multiupload.com/9YMSM9IM6N
Everything should work perfectly with the word wrap option on as it hides the line display. The line display should work too, it's just that there's a couple things that aren't correct with the visual. It doesn't display the correct index sometimes, and the mouse scroll doesn't work for it. Horizontal scroll doesn't appear unless you are scrolled all the way to the bottom.
Enjoy the rest of the countless features i've added over the past few months though.
I got a line display, but it still has a few bugs to work out. I might have to use multithreading to display the numbers as it's a little slow with a lot of numbers. Word wrap on, makes the display go away (because word wrap doesn't have accurate line count). You'd need a more advanced line display like Notepad++...
So far the selected index of the listbox i'm using for the line display is a little off when you hold down the enter/return button to get a lot of line numbers on the left, it can be fixed by going back to the top and moving down, but it changes the index and is in sync with mouse clicks on the rtb control, as well as the up and down arrows
Bugs I know about so far:
-mouse scroll doesn't scroll for the line display view, only with word wrap on where the line display is hidden from view
-app lags a bit with large line counts while line display is showing
-horizontal scrollbar while line display is visible only shows when the scrollbar position is scrolled all the way down, I need to find a way to override the controls position for the scrollbar
-the selected line index on the left (highlight) is "off" by a bit sometimes
Other than that if I had those things fixed everything is good to go. I got the line display synced from switching between word wrap on and off though.
Preview:
I originally started out with a code like this for the line numbers:
Code:
Private Sub RichTextBox1_EnterKeyPressed(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles RichTextBox1.KeyDown
Dim numlinecount As Integer
If e.KeyData = Keys.Enter Then
numlinecount = (RichTextBox2.GetLineFromCharIndex(RichTextBox2.Text.Length)) + 1
RichTextBox2.AppendText(CStr(numlinecount) & vbLf)
End If
End Sub
That was all fine, but I didn't have a way to remove numbers based on how many line chars were removed. I had planned out another method that would count the lines on textchange, but then I realized that it would be too slow because having around 1000 lines, it would have to recount all 1000 before moving to the display for 1001. This is definitely not an easy task for a line display, i've tried all kinds of methods from different snippets created by myself, but nothing seemed to work 100% without at least one flaw.
Download:
http://www.multiupload.com/9YMSM9IM6N
Everything should work perfectly with the word wrap option on as it hides the line display. The line display should work too, it's just that there's a couple things that aren't correct with the visual. It doesn't display the correct index sometimes, and the mouse scroll doesn't work for it. Horizontal scroll doesn't appear unless you are scrolled all the way to the bottom.
Enjoy the rest of the countless features i've added over the past few months though.