Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > VBA / Office Integration > Excel > TextBox CurLine property


Reply
 
Thread Tools Display Modes
  #1  
Old 07-09-2012, 10:14 AM
iabbott iabbott is offline
Junior Contributor
 
Join Date: Jun 2010
Posts: 270
Default TextBox CurLine property


I am having an issue with this property

I have some code that will fill text into a TextBox, once the code has finished, I want to set the cursor to the top of the TextBox

I have found the property TextBox1.CurLine will do this...I can set it to = 1, this will select the 2nd line, = -1 which will select the last line, but when I try to set it to 0 (which should be the 1st line), I get a runtime error

Quote:
Run-time error '-2147418113 (8000ffff)':


Could not set the CurLine property. Unexpected call to method or property access.
I have set the TextBox to have focus, so it's not that, and as I already said, I can set CurLine to any other number with no problem..

Any ideas?
Reply With Quote
  #2  
Old 07-09-2012, 02:43 PM
Cerian Knight's Avatar
Cerian Knight Cerian Knight is offline
Multi-Technologist

Super Moderator
* Expert *
 
Join Date: May 2004
Location: Michigan
Posts: 3,738
Default

Try 'TextBox1.SelStart = 0' instead, which will move the insertion point to the beginning.
Edit: Here is a discussion of the issue, which affects me on a patched Excel 2003, as well: https://groups.google.com/group/micr...808?hl=en-GB&q
__________________
"May the code that you write never work in ways that you didn't expect; and may the code that you didn't write never require you to maintain it". - Ancient Chinese Proverb

Last edited by Cerian Knight; 07-09-2012 at 03:26 PM.
Reply With Quote
  #3  
Old 07-10-2012, 01:18 AM
iabbott iabbott is offline
Junior Contributor
 
Join Date: Jun 2010
Posts: 270
Default

Cool thanks Cerian

Didn't think of that one
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->