Insert line break in text through code

Insert line break in text through code

am 29.01.2008 13:45:03 von JuliaB

Hi all

I've got a bit of code that inserts some text into a text field on a webform
under certain circumstances. The text needs some line breaks in it. This is
what I've done.

Me.OptionalNotesTB.Text = _
"- Unless otherwise offered in this quote no System Data
Requirement Lists " + _
"or other technical documentation is included. " + _
"Should these be required then we would be pleased to quote
for them separately.
" + _
"- Stock subject to prior sales.
" + _
"- Delivery charges will apply where appropriate.
" + _
"- The company has a minimum order charge of $250.00."

Unfortunately this doesn't seem to work. The text displays as follows:

"- Unless otherwise offered in this quote no System Data Requirement Lists
or other technical documentation is included. Should these be required then
we would be pleased to quote for them separately.
- Stock subject to
prior sales. company has a minimum order charge of $250.00."

How do I convert the
into a line break?

Thanks in advance.
Julia

RE: Insert line break in text through code

am 29.01.2008 16:58:01 von Ian

Line breaks with html... i.e.
only work with the literal control I
believe. What I have used in my code is \n, this is a line break that works
with text boxes and the like. Also you could use a resources file and type it
exactly how you want it but use Shift+Enter when you want a new line.

"Julia B" wrote:

> Hi all
>
> I've got a bit of code that inserts some text into a text field on a webform
> under certain circumstances. The text needs some line breaks in it. This is
> what I've done.
>
> Me.OptionalNotesTB.Text = _
> "- Unless otherwise offered in this quote no System Data
> Requirement Lists " + _
> "or other technical documentation is included. " + _
> "Should these be required then we would be pleased to quote
> for them separately.
" + _
> "- Stock subject to prior sales.
" + _
> "- Delivery charges will apply where appropriate.
" + _
> "- The company has a minimum order charge of $250.00."
>
> Unfortunately this doesn't seem to work. The text displays as follows:
>
> "- Unless otherwise offered in this quote no System Data Requirement Lists
> or other technical documentation is included. Should these be required then
> we would be pleased to quote for them separately.
- Stock subject to
> prior sales. > company has a minimum order charge of $250.00."
>
> How do I convert the
into a line break?
>
> Thanks in advance.
> Julia

RE: Insert line break in text through code

am 29.01.2008 17:11:01 von JuliaB

Thanks Ian,

I've tried replacing
in my code with \n and it hasn't made any
difference other than \n displays in the text box.

I don't understand what you mean by using a resources file?

Julia

"Ian" wrote:

> Line breaks with html... i.e.
only work with the literal control I
> believe. What I have used in my code is \n, this is a line break that works
> with text boxes and the like. Also you could use a resources file and type it
> exactly how you want it but use Shift+Enter when you want a new line.
>
> "Julia B" wrote:
>
> > Hi all
> >
> > I've got a bit of code that inserts some text into a text field on a webform
> > under certain circumstances. The text needs some line breaks in it. This is
> > what I've done.
> >
> > Me.OptionalNotesTB.Text = _
> > "- Unless otherwise offered in this quote no System Data
> > Requirement Lists " + _
> > "or other technical documentation is included. " + _
> > "Should these be required then we would be pleased to quote
> > for them separately.
" + _
> > "- Stock subject to prior sales.
" + _
> > "- Delivery charges will apply where appropriate.
" + _
> > "- The company has a minimum order charge of $250.00."
> >
> > Unfortunately this doesn't seem to work. The text displays as follows:
> >
> > "- Unless otherwise offered in this quote no System Data Requirement Lists
> > or other technical documentation is included. Should these be required then
> > we would be pleased to quote for them separately.
- Stock subject to
> > prior sales. > > company has a minimum order charge of $250.00."
> >
> > How do I convert the
into a line break?
> >
> > Thanks in advance.
> > Julia

Re: Insert line break in text through code

am 29.01.2008 17:28:49 von Courtney

"Julia B" wrote in message
news:96B8FE1A-820A-4ED1-8178-F14EAB9B4019@microsoft.com...
> Thanks Ian,
>
> I've tried replacing
in my code with \n and it hasn't made any
> difference other than \n displays in the text box.
>
> I don't understand what you mean by using a resources file?
>
> Julia
>
> "Ian" wrote:
>
>> Line breaks with html... i.e.
only work with the literal control I
>> believe. What I have used in my code is \n, this is a line break that
>> works
>> with text boxes and the like. Also you could use a resources file and
>> type it
>> exactly how you want it but use Shift+Enter when you want a new line.
>>
>> "Julia B" wrote:
>>
>> > Hi all
>> >
>> > I've got a bit of code that inserts some text into a text field on a
>> > webform
>> > under certain circumstances. The text needs some line breaks in it.
>> > This is
>> > what I've done.
>> >
>> > Me.OptionalNotesTB.Text = _
>> > "- Unless otherwise offered in this quote no System
>> > Data
>> > Requirement Lists " + _
>> > "or other technical documentation is included. " + _
>> > "Should these be required then we would be pleased to
>> > quote
>> > for them separately.
" + _
>> > "- Stock subject to prior sales.
" + _
>> > "- Delivery charges will apply where appropriate.
"
>> > + _
>> > "- The company has a minimum order charge of $250.00."
>> >
>> > Unfortunately this doesn't seem to work. The text displays as follows:
>> >
>> > "- Unless otherwise offered in this quote no System Data Requirement
>> > Lists
>> > or other technical documentation is included. Should these be required
>> > then
>> > we would be pleased to quote for them separately.
- Stock subject
>> > to
>> > prior sales. >> > The
>> > company has a minimum order charge of $250.00."
>> >
>> > How do I convert the
into a line break?
>> >
>> > Thanks in advance.
>> > Julia

Since it appears you are using VB as language it does not know what \n is.
Use Environment.NewLine as the line break in your code and all should be
good.

Hope this helps
LS

Re: Insert line break in text through code

am 29.01.2008 17:37:14 von Ian

Ahh yes, didnt switch my thinking... used to C#, Environment.NewLine should
do the same thing.

"Lloyd Sheen" wrote:

>
> "Julia B" wrote in message
> news:96B8FE1A-820A-4ED1-8178-F14EAB9B4019@microsoft.com...
> > Thanks Ian,
> >
> > I've tried replacing
in my code with \n and it hasn't made any
> > difference other than \n displays in the text box.
> >
> > I don't understand what you mean by using a resources file?
> >
> > Julia
> >
> > "Ian" wrote:
> >
> >> Line breaks with html... i.e.
only work with the literal control I
> >> believe. What I have used in my code is \n, this is a line break that
> >> works
> >> with text boxes and the like. Also you could use a resources file and
> >> type it
> >> exactly how you want it but use Shift+Enter when you want a new line.
> >>
> >> "Julia B" wrote:
> >>
> >> > Hi all
> >> >
> >> > I've got a bit of code that inserts some text into a text field on a
> >> > webform
> >> > under certain circumstances. The text needs some line breaks in it.
> >> > This is
> >> > what I've done.
> >> >
> >> > Me.OptionalNotesTB.Text = _
> >> > "- Unless otherwise offered in this quote no System
> >> > Data
> >> > Requirement Lists " + _
> >> > "or other technical documentation is included. " + _
> >> > "Should these be required then we would be pleased to
> >> > quote
> >> > for them separately.
" + _
> >> > "- Stock subject to prior sales.
" + _
> >> > "- Delivery charges will apply where appropriate.
"
> >> > + _
> >> > "- The company has a minimum order charge of $250.00."
> >> >
> >> > Unfortunately this doesn't seem to work. The text displays as follows:
> >> >
> >> > "- Unless otherwise offered in this quote no System Data Requirement
> >> > Lists
> >> > or other technical documentation is included. Should these be required
> >> > then
> >> > we would be pleased to quote for them separately.
- Stock subject
> >> > to
> >> > prior sales. > >> > The
> >> > company has a minimum order charge of $250.00."
> >> >
> >> > How do I convert the
into a line break?
> >> >
> >> > Thanks in advance.
> >> > Julia
>
> Since it appears you are using VB as language it does not know what \n is.
> Use Environment.NewLine as the line break in your code and all should be
> good.
>
> Hope this helps
> LS
>
>

Re: Insert line break in text through code

am 29.01.2008 17:52:36 von JuliaB

That did the trick! Brilliant, thanks for both your help.

Julia

"Ian" wrote:

> Ahh yes, didnt switch my thinking... used to C#, Environment.NewLine should
> do the same thing.
>
> "Lloyd Sheen" wrote:
>
> >
> > "Julia B" wrote in message
> > news:96B8FE1A-820A-4ED1-8178-F14EAB9B4019@microsoft.com...
> > > Thanks Ian,
> > >
> > > I've tried replacing
in my code with \n and it hasn't made any
> > > difference other than \n displays in the text box.
> > >
> > > I don't understand what you mean by using a resources file?
> > >
> > > Julia
> > >
> > > "Ian" wrote:
> > >
> > >> Line breaks with html... i.e.
only work with the literal control I
> > >> believe. What I have used in my code is \n, this is a line break that
> > >> works
> > >> with text boxes and the like. Also you could use a resources file and
> > >> type it
> > >> exactly how you want it but use Shift+Enter when you want a new line.
> > >>
> > >> "Julia B" wrote:
> > >>
> > >> > Hi all
> > >> >
> > >> > I've got a bit of code that inserts some text into a text field on a
> > >> > webform
> > >> > under certain circumstances. The text needs some line breaks in it.
> > >> > This is
> > >> > what I've done.
> > >> >
> > >> > Me.OptionalNotesTB.Text = _
> > >> > "- Unless otherwise offered in this quote no System
> > >> > Data
> > >> > Requirement Lists " + _
> > >> > "or other technical documentation is included. " + _
> > >> > "Should these be required then we would be pleased to
> > >> > quote
> > >> > for them separately.
" + _
> > >> > "- Stock subject to prior sales.
" + _
> > >> > "- Delivery charges will apply where appropriate.
"
> > >> > + _
> > >> > "- The company has a minimum order charge of $250.00."
> > >> >
> > >> > Unfortunately this doesn't seem to work. The text displays as follows:
> > >> >
> > >> > "- Unless otherwise offered in this quote no System Data Requirement
> > >> > Lists
> > >> > or other technical documentation is included. Should these be required
> > >> > then
> > >> > we would be pleased to quote for them separately.
- Stock subject
> > >> > to
> > >> > prior sales. > > >> > The
> > >> > company has a minimum order charge of $250.00."
> > >> >
> > >> > How do I convert the
into a line break?
> > >> >
> > >> > Thanks in advance.
> > >> > Julia
> >
> > Since it appears you are using VB as language it does not know what \n is.
> > Use Environment.NewLine as the line break in your code and all should be
> > good.
> >
> > Hope this helps
> > LS
> >
> >