This is a migrated thread and some comments may be shown as answers.

Remove Default Span and Scrollbars from RadRichTextBox

1 Answer 130 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Doug
Top achievements
Rank 1
Doug asked on 10 Apr 2013, 04:20 PM
I am trying to utilize the RadRichTextBox in Winforms for the purpose of having the integrated spell checker, but I am only in need of a 1-line text box.  I can't seem to find a way to remove the scroll bars when I do that.  Is there a way to do this?

Then, I have figured out how to add a section to the RadRichTextBox.Document by using the .AddBefore(), but is there a way to actually remove the first section completely from the default Document that is created?

Thanks,
Doug

1 Answer, 1 is accepted

Sort by
0
Jack
Telerik team
answered on 12 Apr 2013, 01:36 PM
Hello Doug,

If you want just to use the spell checking feature, then the best option is to work with RadTextBoxControl. The following article from our online documentation describes how to spell check a textbox.

If you still want to use RadRichTextBox, then you can hide all scrollbars by handling the RadPropertyChanging event. You should cancel the changing action when the editor tries to set the Visibility property to Visible. Consider the sample below:
radRichTextBox1.RichTextBoxElement.VScrollBar.Visibility = ElementVisibility.Collapsed;
radRichTextBox1.RichTextBoxElement.HScrollBar.Visibility = ElementVisibility.Collapsed;
 
radRichTextBox1.RichTextBoxElement.VScrollBar.RadPropertyChanging += new RadPropertyChangingEventHandler(ScrollBar_RadPropertyChanging);
radRichTextBox1.RichTextBoxElement.HScrollBar.RadPropertyChanging += new RadPropertyChangingEventHandler(ScrollBar_RadPropertyChanging);
 
void ScrollBar_RadPropertyChanging(object sender, RadPropertyChangingEventArgs args)
{
    if (args.Property == RadElement.VisibilityProperty && (ElementVisibility)args.NewValue == ElementVisibility.Visible)
    {
        args.Cancel = true;
    }
}

I hope this helps. Do not hesitate to ask If you have further questions.

All the best,
Jack
the Telerik team
WinForms Q1 2013 boasts PivotGrid, PDF Viewer, Chart enhancements and more. Check out all of the latest highlights.
Tags
GridView
Asked by
Doug
Top achievements
Rank 1
Answers by
Jack
Telerik team
Share this question
or