is there a way to have the text in a label scroll horizontally,if the text do not fit into the label...
please help...

Scroll text ok, but what did you mean by "if the text do not fit into the label..." ?
ADDED: Text always fits to the label.

Edited 5 Years Ago by Mitja Bonca: n/a

A Label is just that: a Label.
Add some scrollbars to your Form, or put your text in a TextBox and add some scrollbars there.

Edited 5 Years Ago by ddanbe: n/a

I did the code for scrolling text in label.
Take a look at it:

public Form1()
        {
            InitializeComponent();
            label1.Text = "abcde";
        }

        private void button1_Click(object sender, EventArgs e)
        {
            char[] chars = label1.Text.ToCharArray();
            char[] newChar = new char[chars.Length];

            int k = 0;
            for (int j = 0; j < chars.Length; j++)
            {
                if (j + 1 < chars.Length)
                    newChar[j + 1] = chars[j];
                else
                {
                    newChar[k] = chars[j];
                    k++;
                }
            }
            label1.Text = new string(newChar);
        }
public Form1()
        {
            InitializeComponent();
            label1.Text = "abcdefg";
        }

       

        private void button1_Click(object sender, EventArgs e)
        {
            char[] chars = label1.Text.ToCharArray();
            //MessageBox.Show(chars[1].ToString());
            char[] newChar = new char[chars.Length];
            int l = chars.Length;
            int k = 0;
            for (int j = 0; j < chars.Length; j++)
            {
                
                if (j+1  < chars.Length)
                    newChar[j ] = chars[j+1];
                else
                {
                    newChar[l-1] = chars[k];
                  //  k++;
                }
            }
            label1.Text = new string(newChar);
        }

thanks a lottt again.... :) mainly MITJA..

This question has already been answered. Start a new discussion instead.