Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

richTextBox selectedText WinForms

$
0
0
Hello guys. I have a simple Windows Form Application, and I docked on my form an richTextBox. I have set the next lines:
        public Form1()
        {
            InitializeComponent();
            this.Load += new EventHandler(Form1_Load);
        }

        void Form1_Load(object sender, EventArgs e)
        {
            richTextBox1.Text = "This\nis\nmy\nlittle\ntest!";
            richTextBox1.ReadOnly = true;
            richTextBox1.ZoomFactor = 3.0f;
            richTextBox1.SelectAll();
            richTextBox1.SelectionAlignment = HorizontalAlignment.Center;
        }

And when I debug the program, with my mouse I can select the text from my richTextBox, and that cursor for typing appears on my richTextBox ( please check the screenshots ):
cursor: http://img132.imageshack.us/img132/6806/75852424.png
cursor: http://img28.imageshack.us/img28/4209/43502289.png
selected text with mouse: http://img715.imageshack.us/img715/3918/28203295.png

Actually, I tried with richTextBox.Enabled = false, but this property change my background color and my foreground color of my richTextBox...

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>