Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WinForms > Dock > Single Control with DockStyle.Fill in ToolWindow or DocumentWindow Doesn't Resize

Not answered Single Control with DockStyle.Fill in ToolWindow or DocumentWindow Doesn't Resize

Feed from this thread
  • Posted on Aug 3, 2011 (permalink)

    Hello,

    I have built an application that uses the Winform version of both RadDock ToolWindows and RadDock DocumentWindows inside of a RadDock container.

    Each of these RadDock DockWindows has a single textbox control or custom UserControl in it, with:

    singleDockedControl.Dock = DockStyle.Fill;

    The problem I am having is that when I expand/maximize the entire WinForm, the DocumentWindows and ToolWindows expand nicely, but the controls inside them look "cut off" on the righthand size... a textbox with a  long line of text gets cut in half, and the last half of the line of text is not visible on the containing DockWindow, even though there is lots of empty white space on the righthand side of the containing DockWindow.  It appears that the textbox grows correctly, due to its Dock = DockStyle.Fill, but the righthand side of the DockWindow doesn't get repainted to show it.  This problem doesn't happen when a textbox or UserControl is placed directly on a test Winform that is expanded/maximized. 

    Does anybody know what I can do to fix this problem?

    Thank you very much in advance for your help!

    Brook

    Reply

  • Posted on Aug 7, 2011 (permalink)

    Hello,

    Can anybody out there help me with my question in my previous post shown on this Web page?

    It's been a  few days and haven't got any feedback, so I thought I would add some more information that should be helpful, as can be seen in the attached image...

    The attached image shows the problem... notice how the Telerik ToolWindow at the bottom has cut off text on the right side.

    Thanks in advance to anybody that can help me with this frustrating bug!

    Brook

    Reply

  • Say Hello to Telerik's PivotGrid for ASP.NET AJAX, Silverlight, WPF and WinForms. Now packed with OLAP support.
  • Stefan Stefan admin's avatar

    Posted on Aug 8, 2011 (permalink)

    Hi Brook,

    Thank you for writing.

    I was able to reproduce this behavior. It is occurs when the selection of the text box is at the end of the control and the the form is expanded. This causes the control size to expand but the editing area remains the same. The same behavior can be observed with the standard Microsoft text box control.

    However, in order to overcome this behavior, please subscribe to the SizeChanged event of your form and when such appears, change the SelectionStart property to 0 and then back to its previous value:

    void Form1_SizeChanged(object sender, EventArgs e)
            {
                int save = radTextBox1.SelectionStart;
                radTextBox1.SelectionStart = 0;
                radTextBox1.SelectionStart = save;
            }

    Let me know whether this helps. 

    All the best,
    Stefan
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

    Reply

  • Posted on Aug 8, 2011 (permalink)

    Hi Stefan,

    Many thanks for your response.

    For whatever reason that is probably quite specific to my application, your solution didn't work in my particular case.

    However, you got me thinking when you said that the .NET TextBox has the same problem.  So I replaced the .NET TextBox with a .NET RichTextBox and this fixed the problem.

    Thanks again for your help.  I guess one lesson is use a RichTextBox instead of a TextBox if you want a large textbox with many lines that is ocked and needs to expand and contract nicely and always repaint correctly.

    Brook

    Reply

  • Stefan Stefan admin's avatar

    Posted on Aug 11, 2011 (permalink)

    Hi Brook,

    Thank you for writing back.

    Indeed RichTextBox is the better choice when you have lager text portions. I would like to mention that in Q2 2011 we have added a new control to our suite - RadRichTextBox. It is still in its beta version but you can try it out. Should you have any feedback regarding this control, do not hesitate to contact us.
     
    Greetings,
    Stefan
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

    Reply

  • Say Hello to Telerik's PivotGrid for ASP.NET AJAX, Silverlight, WPF and WinForms. Now packed with OLAP support.

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WinForms > Dock > Single Control with DockStyle.Fill in ToolWindow or DocumentWindow Doesn't Resize
Related resources for "Single Control with DockStyle.Fill in ToolWindow or DocumentWindow Doesn't Resize"

[ Features | Demos | Documentation | Knowledge Base | Telerik TV | Code Library | Step-by-step Tutorial | Blogs | Self-Paced Trainer ]