|
-
Oct 8th, 2001, 03:11 PM
#1
Thread Starter
Addicted Member
Two Questions
1.) Is it possible to get the visible text in a multiline textbox? In other words a function that returns the text that is visible and not any text that is beyond the end of the textbox? Or similar result?
2.) Is there anyway to return a string containing the text of a specified line of a text box?
Thanks
BestCoder
-
Oct 8th, 2001, 04:24 PM
#2
Member
1. Not sure but probably an API call
2. Haven't tested this (I don't have VB6 (VB5 instead) so I can't ):
VB Code:
Const LineNumber As Long = 5 ' get the 6th line
Msgbox Split(Text1.Text, vbCrLf)(LineNumber)
-
Oct 8th, 2001, 04:27 PM
#3
PowerPoster
-
Oct 8th, 2001, 04:29 PM
#4
PowerPoster
Originally posted by filburt1
2. Haven't tested this (I don't have VB6 (VB5 instead) so I can't ):
VB Code:
Const LineNumber As Long = 5 ' get the 6th line
Msgbox Split(Text1.Text, vbCrLf)(LineNumber)
err...how can I put this...no.
-
Oct 8th, 2001, 09:10 PM
#5
Fanatic Member
chrisjk, what filburt said does work. Why did you say 'no' there?
Back to the two questions:
1) Check out article Q88387 in MSDN. It's about getting the visible lines of text from a textbox as you asked.
2) You can use what filburt mentioned if you don't want any extra work (but it may slow down on large amounts of text as the system breaks up the text with Split()), or you can use an API method. In an old thread Nucleus started, I added some other props that would be useful for textboxes, and one of them will show the API way of getting a line. This is the thread: http://www.vbforums.com/showthread.p...threadid=97916
The relevant part is at the very bottom in my last post to the thread.
I'm baaaack...
VB5 Professional Edition, VC++ 6
Using a 1 gHz Thunderbird, 256 mb RAM, 40 gb HD system with Win98se
I feel special because I finally figured out how to loop midis: Post link
I'm a fanatic too 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|