按钮单击时删除RichTextBox中的段落 [英] Delete paragraphs in RichTextBox on button click

查看:73
本文介绍了按钮单击时删除RichTextBox中的段落的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个RichTextBox和一些按钮(TEMPLET1,TEMPLET2,TEMPLET3 ....)。单击按钮时,第一次将2段文本添加到RichTextBox的FlowDocument。



以下是应用程序的屏幕截图。



ClickHere



我的问题是,当我第二次点击其各自的模板按钮时,如何从RichTextBox中删除特定模板。



任何想法受欢迎的。如果有人可以提供示例代码,那就太好了。



提前谢谢。

解决方案

好吧,不要把按钮放在这个控件里面。为什么?做一些不错的UI设计,找到一个适合这个按钮的好地方,比如工具栏/工具箱。这个动作不是唯一的,所以你可以让自己把它们放在一起。顺便说一下,这是大多数客户所期望的,而且你不应该过多地混淆它们。然后,传统菜单出了什么问题?即使你还有别的东西,全面的传统菜单也是所有或多或少复杂应用的必备条件。



-SA

I have a RichTextBox and some Buttons(TEMPLET1,TEMPLET2,TEMPLET3....). When a button is clicked 1st time 2 paragraphs of text is added to the FlowDocument of the RichTextBox.

Below is the screenshot of the application.

ClickHere

My question is, how can i delete a specific template from RichTextBox when i click its respective template button 2nd time.

Any ideas are welcome. It would be great if someone can give a sample code on this.

Thanks in advance.

解决方案

Well, don't put the button inside this control. Why? Do some nice UI design and find a nice place for this button, such as a toolbar/toolbox. This action is not the only one, so you can allow yourself to put them all together. By the way, this is want most customers will expect, and you should not confuse them too much. And then, what's wrong with traditional menu? Even if you have something else, the comprehensive traditional menu is a must for all more or less complex applications.

—SA


这篇关于按钮单击时删除RichTextBox中的段落的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆