Showing posts with label sentences. Show all posts
Showing posts with label sentences. Show all posts

Monday, March 26, 2012

Text in a textbox

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 @dotnet.itags.org. http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...is the textbox.textmode set to "MultiLine" ?

"Paul P" <pphillips@.rattanconsulting.com> wrote in message
news:OF3GSQN8DHA.1672@.TK2MSFTNGP12.phx.gbl...
> 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...
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...
> 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" <pphillips@.rattanconsulting.com> wrote in message
news:eS97SWN8DHA.2404@.TK2MSFTNGP12.phx.gbl...
> 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...
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" <pphillips@.rattanconsulting.com> wrote in message
news:eS97SWN8DHA.2404@.TK2MSFTNGP12.phx.gbl...
> 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...
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.

"S. Justin Gengo" <sjgengo@.aboutfortunate.com> wrote in message
news:e77CboN8DHA.3288@.TK2MSFTNGP11.phx.gbl...
> 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" <pphillips@.rattanconsulting.com> wrote in message
> news:eS97SWN8DHA.2404@.TK2MSFTNGP12.phx.gbl...
> > 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...

Thursday, March 22, 2012

TextArea question

Hi Y'all,

Is it possible to make a textarea where some sentences/words at certain positions can't be altered? I want to make a textarea with a pre-defined lay-out without working with labels.

Thanks!

Could you please tell me a scenario where you need such type restrictions ?


navaneethkn:

Could you please tell me a scenario where you need such type restrictions ?

Honestly speaking, i'm also very curious abou this.

i think the general way/most common way is using label with textbox.My opinion may be TOTALLY WRONG.Based on my understanding, you cannot set "a fixed text area" within your textbox--the page code is transported to the client and get rendered by the IE browser, users can do whatever they want to a textbox/textarea without your notice on server side. well, maybe there is a way using javascript or ajax, but as far as i konw, i never heard about it.

Hope my suggestion helps :)


Hello

Yes, I was also confused by seeing the question. I tried several combination to make it work. But I think it is not possible to restrict some area of a control as not editable. One think can be done is using javascript as you told. If he knows the letters/words that can't be edited, this can be done using javascript. But it will take the entire contents of text area. Not in specific locations. Is there any function available in javascript to find current cursor position ?