Numbered textbox? - Vb.net
Do you need something made? then ask in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
I tried both of them again and yes, one of them is for vb.net but its code is too long. I'll ask MTech what he used in his notepad.
Usman55 wrote:I tried both of them again and yes, one of them is for vb.net but its code is too long. I'll ask MTech what he used in his notepad.lol, that one it wont let me open ;), vb.net 6?
Livengood wrote:Converted the code but dunno if it is right or worksAxel wrote:http://www.codeproject.com/KB/cpp/linen ... r_rtb.aspx for richtextbox(It auto resizes, when you zoom for example
For a normal textbox, just use the listbox method
also this is a nice one
http://www.codeproject.com/KB/edit/numberedtextbox.aspx
These all are not in visual basic.. ones in C# and another idk..
Your Code Has Arrived! wrote:Code: Select allPrivate Sub updateNumberLabel() 'we get index of first visible char and 'number of first visible line Dim pos As New Point(0, 0) Dim firstIndex As Integer = richTextBox1.GetCharIndexFromPosition(pos) Dim firstLine As Integer = richTextBox1.GetLineFromCharIndex(firstIndex) 'now we get index of last visible char 'and number of last visible line pos.X = ClientRectangle.Width pos.Y = ClientRectangle.Height Dim lastIndex As Integer = richTextBox1.GetCharIndexFromPosition(pos) Dim lastLine As Integer = richTextBox1.GetLineFromCharIndex(lastIndex) 'this is point position of last visible char, we'll 'use its Y value for calculating numberLabel size pos = richTextBox1.GetPositionFromCharIndex(lastIndex) 'finally, renumber label numberLabel.Text = "" For i As Integer = firstLine To lastLine + 1 numberLabel.Text += i + 1 & vbLf Next End Sub
You could use this control I used back in the 2008 version, it wont work in the 2010 version for me :( But here's a link: http://scintillanet.codeplex.com/
Visit BW Photography and check out my photos!
Usman55 wrote:Axel, I tried both the links but they don't seem to work. They are not compatible with .net I guess.What? Thats bullshit haha :P
Livengood wrote:Well you can compile them in C# as a .dll file and use them in vb (make sure the framework version of the textbox is equal to or lower than your application framework)Axel wrote:http://www.codeproject.com/KB/cpp/linen ... r_rtb.aspx for richtextbox(It auto resizes, when you zoom for example
For a normal textbox, just use the listbox method
also this is a nice one
http://www.codeproject.com/KB/edit/numberedtextbox.aspx
These all are not in visual basic.. ones in C# and another idk..
code it wrote:yeah you can but dont you have c# ?I have C# yes...
MrBrockWalker wrote:You could use this control I used back in the 2008 version, it wont work in the 2010 version for me :( But here's a link: http://scintillanet.codeplex.com/lol im using vb 10
It supports 2010 too and it has support for .Net Framework 4.0 as well.
Copyright Information
Copyright © Codenstuff.com 2020 - 2023