Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old April 4th, 2006, 01:10 PM
ALEX_GRIM's Avatar
ALEX_GRIM ALEX_GRIM is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Apr 2005
Posts: 67 ALEX_GRIM User rank is Corporal (100 - 500 Reputation Level)ALEX_GRIM User rank is Corporal (100 - 500 Reputation Level)ALEX_GRIM User rank is Corporal (100 - 500 Reputation Level)ALEX_GRIM User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 16 h 35 m 19 sec
Reputation Power: 5
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

Reply With Quote
  #2  
Old April 4th, 2006, 04:55 PM
Doug G Doug G is offline
Grumpier Old Moderator
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Sep 2003
Posts: 10,143 Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 23 h 29 m 58 sec
Reputation Power: 181
Quote:
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.

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

Reply With Quote
  #3  
Old April 4th, 2006, 06:28 PM
ALEX_GRIM's Avatar
ALEX_GRIM ALEX_GRIM is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Apr 2005
Posts: 67 ALEX_GRIM User rank is Corporal (100 - 500 Reputation Level)ALEX_GRIM User rank is Corporal (100 - 500 Reputation Level)ALEX_GRIM User rank is Corporal (100 - 500 Reputation Level)ALEX_GRIM User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 16 h 35 m 19 sec
Reputation Power: 5
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
MessageBox.Show("Give up")
End Select

See what i mean?

Reply With Quote
  #4  
Old April 4th, 2006, 07:49 PM
Doug G Doug G is offline
Grumpier Old Moderator
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Sep 2003
Posts: 10,143 Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 23 h 29 m 58 sec
Reputation Power: 181
Quote:
Are you implying that i have done this before?

No. To simplify, please don't crosspost, regardless of what you think the logic should be.

Reply With Quote
  #5  
Old April 4th, 2006, 09:09 PM
ALEX_GRIM's Avatar
ALEX_GRIM ALEX_GRIM is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Apr 2005
Posts: 67 ALEX_GRIM User rank is Corporal (100 - 500 Reputation Level)ALEX_GRIM User rank is Corporal (100 - 500 Reputation Level)ALEX_GRIM User rank is Corporal (100 - 500 Reputation Level)ALEX_GRIM User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 16 h 35 m 19 sec
Reputation Power: 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.

Reply With Quote
  #6  
Old April 4th, 2006, 09:18 PM
Doug G Doug G is offline
Grumpier Old Moderator
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Sep 2003
Posts: 10,143 Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 23 h 29 m 58 sec
Reputation Power: 181
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?

Reply With Quote
  #7  
Old April 4th, 2006, 10:00 PM
ALEX_GRIM's Avatar
ALEX_GRIM ALEX_GRIM is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Apr 2005
Posts: 67 ALEX_GRIM User rank is Corporal (100 - 500 Reputation Level)ALEX_GRIM User rank is Corporal (100 - 500 Reputation Level)ALEX_GRIM User rank is Corporal (100 - 500 Reputation Level)ALEX_GRIM User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 16 h 35 m 19 sec
Reputation Power: 5
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.

Reply With Quote
  #8  
Old April 5th, 2006, 01:42 AM
Doug G Doug G is offline
Grumpier Old Moderator
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Sep 2003
Posts: 10,143 Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 23 h 29 m 58 sec
Reputation Power: 181
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.

Reply With Quote
  #9  
Old April 11th, 2006, 08:06 AM
Sarvapriya Sarvapriya is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Apr 2006
Posts: 1 Sarvapriya User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 m 54 sec
Reputation Power: 0
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


Reply With Quote
  #10  
Old April 11th, 2006, 09:12 AM
Darius Darius is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 108 Darius User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 h 16 m 54 sec
Reputation Power: 5
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.

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > Find the Current col & row Position of the caret within a TextBox


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT