[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 350
  • Last Modified:

Detecting the line within a text box

I have an Access database containing a text box object linked to a memo field.  I need to be able to know what line the user is on (within this field).  If they are editing on line 1 - great.  If they are editing line 2 onwards, then it will do something else.

Any suggestions?
0
Andy Brown
Asked:
Andy Brown
1 Solution
 
peter57rCommented:
How are you defining a 'line'?

Does the text contain embedded newline characters?  
0
 
Andy BrownAuthor Commented:
Hi Pete.

Line = Verticle position of cursor (for instance line 1 of paragraph 1)

Yes, I was just thinking about determining the cursors position and was that before a carriage return.
0
 
Dale FyeCommented:
The problem with memo fields and text for that matter is that when viewed in a textbox, they wrap based on the width of the textbox.  You can easily determine what position within the textbox the cursor is located at using the textboxes selStart property.  But determining what "line" that is on in the textbox depends on the font, fontsize, and width of the textbox.
0
 
fabriciofonsecaCommented:
Good morning. This page may help you

http://www.vbforfree.com/?p=375


I'll try to implement an example and post soon if it works
0
 
Andy BrownAuthor Commented:
Great stuff - thanks guys for your help
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now