Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 54
Default Textbox linewrap with vbCrLf problem

I am trying to display some tab delimited data in a textbox.

The text box is not wide enough to see all the data.
I have a vbCrLf at the end of each record.

So my text box is being populated like this:
For I = 1 to alot
TB_output = TB_output & data1 & vbTab & data2 & ...... & vbCrLf
Next alot

I have scroll bars turned on and multiline = true
However it wraps data to the next line in the textbox before the
vbCrLf statement and at the vbCrLf.
The scroll bar is NOT displayed

If I turn multiline to False I get the scroll bars to appear but data
is all on one line and the vbcrlf is displayed as a character.

How do I see multiline data and horizontal scroll bars using vbCrLf

I may have too many lines to put into a list box. Plus I want the
option to copy and paste data easily in the future
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Textbox linewrap with vbCrLf problem

If I follow, you want the right edge of the multiline brak to the right of
the visible width of the text box. Seems to defeat what MultiLine provides,
but here are a couple of ideas for what I think you might be after -

1.
Place your line-breaks where you want the (use vbLf rather than vbCrLF)
MultiLine = True and WordWrap = False

2
Set the width of the Textbox to the overall width you want to scroll to (ie
wider than you want it to appear on the form)
MultiLine = True, WordWrap = true
Size a Frame to the visible size you want for your textbox, a little taller
to allow for the H-scroll.
Remove the frame's caption
Cut the Textxbox, select the frame, and paste into the frame. Position to
top-left corner of the frame.
Add the horizontal scrollbar to the frame and set its scrollwidth to that of
the width of the textbox (might need to adjust slightly), eg
With Me.Frame1
..TextBox1.Left = 0
..TextBox1.Top = 0
..ScrollWidth = .TextBox1.Width
End With

Regards,
Peter T



"gtslabs" wrote in message
...
I am trying to display some tab delimited data in a textbox.

The text box is not wide enough to see all the data.
I have a vbCrLf at the end of each record.

So my text box is being populated like this:
For I = 1 to alot
TB_output = TB_output & data1 & vbTab & data2 & ...... & vbCrLf
Next alot

I have scroll bars turned on and multiline = true
However it wraps data to the next line in the textbox before the
vbCrLf statement and at the vbCrLf.
The scroll bar is NOT displayed

If I turn multiline to False I get the scroll bars to appear but data
is all on one line and the vbcrlf is displayed as a character.

How do I see multiline data and horizontal scroll bars using vbCrLf

I may have too many lines to put into a list box. Plus I want the
option to copy and paste data easily in the future



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,510
Default Textbox linewrap with vbCrLf problem

Untested: In the Text box properties try setting the EnterKeyBehaviour to
True. This is the property that allows the use of the enter key for the next
line when entering text manually.

--
Regards,

OssieMac


"gtslabs" wrote:

I am trying to display some tab delimited data in a textbox.

The text box is not wide enough to see all the data.
I have a vbCrLf at the end of each record.

So my text box is being populated like this:
For I = 1 to alot
TB_output = TB_output & data1 & vbTab & data2 & ...... & vbCrLf
Next alot

I have scroll bars turned on and multiline = true
However it wraps data to the next line in the textbox before the
vbCrLf statement and at the vbCrLf.
The scroll bar is NOT displayed

If I turn multiline to False I get the scroll bars to appear but data
is all on one line and the vbcrlf is displayed as a character.

How do I see multiline data and horizontal scroll bars using vbCrLf

I may have too many lines to put into a list box. Plus I want the
option to copy and paste data easily in the future

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Remove small square caused by vbCrLf SF Excel Programming 0 October 15th 08 06:57 PM
Deleting a row in a message (opposite to VbCrLf) Wesslan Excel Programming 3 February 14th 08 08:13 PM
VBCRLF not doing anything [email protected] Excel Programming 3 January 16th 07 06:08 PM
Automatic linewrap with formulas displayed Christopher R. Lee Excel Worksheet Functions 1 February 17th 05 12:56 AM
square boxes when using vbcrlf Joan[_2_] Excel Programming 5 August 5th 03 05:19 PM


All times are GMT +1. The time now is 01:44 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"