Text in a textbox

P

pphillips

On my webform I have a textbox. When the page loads I put some text in the textbox. The text is 2 sentences and all I want to do is to put the sentences on different lines.

It use to be so simple:

textbox1.text = "Sentence1." & vbCrLf & "Sentence2."

The above doesn't seem to work the sentences are on the same line.

Please help with this simple thing.....

Thanks

**********************************************************************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...
 
M

Michael Ramey

is the textbox.textmode set to "MultiLine" ?

Paul P said:
On my webform I have a textbox. When the page loads I put some text in
the textbox. The text is 2 sentences and all I want to do is to put the
sentences on different lines.
It use to be so simple:

textbox1.text = "Sentence1." & vbCrLf & "Sentence2."

The above doesn't seem to work the sentences are on the same line.

Please help with this simple thing.....

Thanks

**********************************************************************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP &
ASP.NET resources...
 
P

pphillips

I tried the multiline option but it has the scroll bar on it and I don't want to see the scroll bars. If you know of a way to get rid of the scroll bars, please let me know.

**********************************************************************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...
 
K

Kevin Spencer

I tried the multiline option but it has the scroll bar on it and I don't
want to see the scroll bars. If you know of a way to get rid

Sure. Use an editable Div instead. You can make it look any way you want it
to. If you need server-side functionality, use the Panel Control, which
renders a Div.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

Paul P said:
I tried the multiline option but it has the scroll bar on it and I don't
want to see the scroll bars. If you know of a way to get rid of the scroll
bars, please let me know.
**********************************************************************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP &
ASP.NET resources...
 
S

S. Justin Gengo

Paul,

You'll have to set the text box to multi-line to get your two lines of text.

One way to get rid of the scroll bar would be to use cascading style sheets:

..TextBox {
overflow: hidden
}

You could add this to your page's style sheet and then assign ".TextBox" to
the CssStyle of the text box.

The choices you may assign to overflow are:

auto - If the content is clipped, the browser should display a scroll-bar to
see the rest of the content

hidden - The content is clipped, but the browser does not display a
scroll-bar to see the rest of the content

scroll - The content is clipped, but the browser displays a scroll-bar to
see the rest of the content

visible - The content is not clipped. It renders outside the element.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche


Paul P said:
I tried the multiline option but it has the scroll bar on it and I don't
want to see the scroll bars. If you know of a way to get rid of the scroll
bars, please let me know.
**********************************************************************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP &
ASP.NET resources...
 
K

Kevin Spencer

This is a better solution than the div solution I offered, if the content is
supposed to be editable, and if the content should be posted back to the
server.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,233
Members
46,820
Latest member
GilbertoA5

Latest Threads

Top