RadTextbox not scrolling when resizing the texbox to show whole text

1 Answer 74 Views
TextBox
John
Top achievements
Rank 1
John asked on 03 Sep 2021, 02:56 PM

Hi,

Am using a telerik winform that contains a telerik textbox and the form can be resized which in turn would resize the textbox as well.

When we enter long text in the textbox and resize the textbox the text is not scrolled to show the text and cursor is at the end of the text which is fine.

For instance, in the image below the text is hidden and after resizing the text should scroll to show text depending on the length of the textbox.

Could you please help with a suitable solution, thank you!

1 Answer, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 07 Sep 2021, 10:07 AM

Hello, John,

In order to force the whole text to be displayed, you can use the following approach:

        public RadForm1()
        {
            InitializeComponent();

            this.radTextBox1.SizeChanged += radTextBox1_SizeChanged;
        }

        private void radTextBox1_SizeChanged(object sender, EventArgs e)
        {
            this.radTextBox1.SelectionStart = 0;
            this.radTextBox1.SelectionStart = this.radTextBox1.Text.Length ;
        }

The achieved result is illustrated in the gif file.

I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

Regards,
Dess | Tech Support Engineer, Principal
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
TextBox
Asked by
John
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or