|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Find the Current col & row Position of the caret within a TextBox
Ok, first off, the name of this forum is ".Visual Basic" but it is unclear as to if it is for old school vb or for .Net, so i'm going to go ahead and post my question here, and then in the .Net forum just to be sure. So i apologize in advance if you see this twice.
My question is this: How do i, or rather "with what syntax" would i tell a label control in a visual basic application to display the current position of the caret. I am writing my own little text editor to make writing scripts faster than when i write them with notepad. The only thing is, when your server gives you an error, in php and most other languages, it will tell you what row and column the error is on. In notepad you can enable an option that will tell you what your caret's position is, which makes it faster to hunt down your errors, but i cannot figure out how to do this for my application. I've been looking this up for a few days now, but all the examples i've seen are for the current position of the mouse, not the caret's position when inside the textbox control. Thanx in advance for any assistance. ------------------------------------ Alex Grim GrimMusic.com |
|
#2
|
|||
|
|||
|
Quote:
And this will be the last time you crosspost, right? ![]()
__________________
====== Doug G ====== I didn't attend the funeral, but I sent a nice letter saying I approved of it. --Mark Twain |
|
#3
|
||||
|
||||
|
Are you implying that i have done this before?
As i stated above, i only cross posted because the area i'm looking to post in is undefined. Dim MyPost as String = forum.where.my.post.is.ToString() Select Case MyPost Case MyPost = Vb.forums MessageBox.Show("This post will not recieve any assistance because this is NOT a Vb.Net forum, only Old Vb") Case MyPost = .Net.Developers.forums MessageBox.Show("This post will not recieve any assistance because this is an ASP.Net forum") Case Else End SelectMessageBox.Show("Give up") See what i mean? |
|
#4
|
|||
|
|||
|
Quote:
No. To simplify, please don't crosspost, regardless of what you think the logic should be. |
|
#5
|
||||
|
||||
|
Ok then. But for future reference, the next time i need to post a topic, and the neccessary forum is ambiguos, what do you propose that i do? Because if i post in the wrong forum, it gets me and any one else who is looking for the same assistance nowhere.
BTW, If my question is answered in one forum, i will reply to the topic in the other forum to let people know which forum the answer was posted in. Again, i meant no harm, but you have to admit, it really is unclear as to which forum is appropriate in this case. |
|
#6
|
|||
|
|||
|
Post in the forum you think is most applicable. For example, if you're using VB.NET try the net forum first, for VB6 and VBA try here first, and moderators will either suggest a better forum for you or move your post.
The advent of VB.Net did muddy the waters a bit. BTW, are you writing in VB.Net or some other flavor of VB? |
|
#7
|
||||
|
||||
|
The application that i am posting about is vb.net. i don't know any other version, i've messed with vb6 a bit before jumping into asp.net, but i've never even Heard of vba.
In case i just raised a question, to answer it in advance: no, this is not vb.net for asp.net, it is for a desktop application, but i am an asp.net guy, that's why i already know a little bit about what's going on in the app side of things, well, syntax-wise anyway. Thanks again for your time. |
|
#8
|
|||
|
|||
|
I don't know net controls, but in VB6 in a text box the SelStart property will tell you where the insertion cursor is as long as SelLength is 0. If SelLength has length then I don't know if the cursor is at the beginning or the end of the selected text.
|
|
#9
|
|||
|
|||
|
Updating Text at a particular position in a textbox
This was troubling me for a while hers the solution:
use after you place the caret where you want in a textbox do Clipboard.SetDataObject("some text") to place something to your clipboard. then Txtbox1.paste txtbox1.focus ![]() |
|
#10
|
|||
|
|||
|
Maybe it's not what you want but....
Why don't use richtextbox?, you will have all the facilities for textbox and more. The selstart works fine. |
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > Find the Current col & row Position of the caret within a TextBox |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|