开发者

Limit DevExpress RichEditControl to a single page

开发者 https://www.devze.com 2023-03-13 02:26 出处:网络
RichEditControl in DXperience WinForms has a view named \'Pr开发者_StackOverflowintLayoutView\'. This view displays documents as pageable, rather than infinite. I\'d like to limit the control to show

RichEditControl in DXperience WinForms has a view named 'Pr开发者_StackOverflowintLayoutView'. This view displays documents as pageable, rather than infinite. I'd like to limit the control to show only first page of the document and control page navigation programmatically.

Is this accomplishable?


The XtraRichEdit does not provide an elegant way to implement this task. The only solution is to turn off all scrollbars (RichEditControl.Options.HorizontalScrollbar.Visibility and RichEditControl.Options.VerticalScrollbar.Visibility) and finally create commands to programmatically change the current Page, you should execute the RichEdit's NextPageCommand. To learn about commands, please refer to the Commands topic.

Update

    GoToPageCommand goToPageCommand = new GoToPageCommand(richEditControl1);
    ICommandUIState state = goToPageCommand.CreateDefaultCommandUIState();
    state.EditValue = 10;
    goToPageCommand.ForceExecute(state);
0

精彩评论

暂无评论...
验证码 换一张
取 消