Question

i need to write a list of url in a textbox in a window apps but when i write it he was mixed like http://google.comhttp://google.comhttp://google.comi

but i want to show clearly i already used
"\n\r" method but he not worked are any sollution for it

Was it helpful?

Solution

yes First you need to set the multiline property to True and better to use Environment.NewLine to set the new line.

Or in stringBuilber.AppedLine("")

Hope this will helpo you :)

OTHER TIPS

Try to use "\n\r" for line break.

You need set the multiline property of your Textbox to true. Then use Environment.NewLine to do a cr/lf (this is equivalent to /r/n)

http://msdn.microsoft.com/en-us/library/system.windows.forms.textbox.aspx

You will need to use a multiline textbox for this. Place Environment.NewLine after each url and it should work.

BTW why are you not using ListBox or ListView?

When working with string or such, try using StringBuilder, it works in my app.

private void FillTextBox()
    {
        StringBuilder st = new StringBuilder();
        st.AppendLine("http://www.google.be");
        st.AppendLine("http://www.google.be");
        st.AppendLine("http://www.google.be");
        st.AppendLine("http://www.google.be");
        st.AppendLine("http://www.google.be");
        st.AppendLine("http://www.google.be");
        st.AppendLine("http://www.google.be");
        textBox1.Text = st.ToString();
    }
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top