问题标签 [richeditbox]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
353 浏览

c# - 如何在 UWP 中的 RichEditBox 中获取图像

RichEditBox在 UWP 中有一个图像已经插入其中。当图像被插入时,它被赋予了一定的宽度和高度(以像素为单位)。现在,插入图像后,我想选择图像并编辑尺寸。有什么办法可以做到这一点?

另外,我看到了一个类似的线程,它的答案不正确。请记住,这是针对 WINRT (UWP) 的。

如何从 RichEditBox 中获取图像

0 投票
0 回答
41 浏览

c# - Caliburn Micro 和 RichEditBox

我想做两种方式绑定RichEditBoxText对于这个控件,我必须使用 Attached属性,因为RichEditBox.

做绑定。

在视图模型中。

但它不起作用。初始值放在富编辑框中。但编辑它们对此属性没有影响。有什么问题?


我想坚持使用 Caliburn micro 和 WinRT,请不要推荐其他工具包。谢谢你。


这个答案给出了一些观点,但那是为了PasswordBox. 有任何想法吗?

0 投票
1 回答
1112 浏览

uwp - 如何将数据绑定到 UWP 中 RichEditBox 的纯文本值?

使用 UWP 中的法线TextBox,您可以将数据绑定到Text属性并轻松地从 ViewModel 获取或设置值。但是,RichEditBox它没有数据绑定Text属性;相反,您必须使用属性公开的ITextDocument接口Document并使用各种方法来获取和设置文本。

如何将纯文本数据绑定到 ViewModel 中的某些内容?

0 投票
1 回答
168 浏览

c# - 当我使用打开文件选择器打开 RichEditBox UWP C# 的文本文件时访问被拒绝

我想用 Open File Picker 打开一个文本文件并显示在 RichEditBox 中,但是当我选择文件并按下 Ok 时,Visual Studio 显示“访问被拒绝”,我想知道如何解决这个问题,这是我的代码:

0 投票
1 回答
69 浏览

c# - RichTextFormat 作为变量类型

我正在尝试制作一个通用 Windows 平台 (UWP) 程序,其中我有一个 RichEditBox,它允许我为几个单独的对象编写富格式文本。我希望能够单击一个对象,然后显示与该对象关联的文本。

单击对象 -> RichEditBox 以 RTF(富文本格式)显示该对象的文本。

单击另一个对象 -> RichEditBox 现在显示属于最新对象的文本。

目前我只能将输入保存为字符串,但这会丢失输入的格式(特别是单词的颜色)。

如何以允许我保留格式的方式保存我的输入(将数据保存在 RAM 中)?

我可以使用某种变量类型吗?

0 投票
1 回答
192 浏览

c# - UWP C#。RichEditBox 中的拦截复制命令

我正在使用 Xaml 和 C# 开发 UWP 应用程序。这是我的问题。

我的应用程序使用 RichEditBox 来处理文本。每次用户关闭应用程序时,从应用程序内复制的剪贴板内容都会被清除。要解决这个问题,我必须使用 Clipboard.Flush()。好的,但是当我不控制复制过程时会发生什么。如果用户按 Crtl+C 或使用 RichEditBox 上下文菜单复制文本,我无法拦截该操作。另一种解决方法是使用 Clipboard.ContentChanged。但是当我在这种情况下使用它时,由于某种原因,该方法会创建一个无限循环。请,任何帮助。

0 投票
1 回答
108 浏览

uwp - How to autosave RichEditBox text?

I tried FileIO.WriteTextAsync(); with many events including Grid.Loaded and RichEditBox.TextChanged, but that method is asynchronous and conflicts with process called previous cycle. As a result, System.IO.FileLoadException with following description:

The process cannot access the file because it is being used by another process.

So what can I do in this case?

0 投票
1 回答
220 浏览

uwp - UWP RichEditBox 禁用图像调整大小

我正在尝试构建一个本机编辑器,其中我有一个丰富的编辑框,我可以在其中插入图像。我可以从编辑器调整图像大小,如何禁用调整大小。另外在此处输入图像描述,我怎样才能取回插入的图像。

0 投票
0 回答
83 浏览

uwp - UWP RichEditBox ITextRange 有图像

我有一个richeditbox,我需要在其中找出 ITextRange 是否有图像。请帮我解决一下这个。

0 投票
2 回答
165 浏览

uwp - RichEditBox looses color formatting when disable then enable

I am using a RichEditBox in a UWP application, and I need to enable and disable it in the software to perform some tasks. The issue I am running into is that when I disable, then re-enable it, any color formatting gets lost. I have created a simple example here, to try out the issue. You can type some text, color it in red, then disable and re-enable. The color gets reverted to black.

XAML

C#

This looks like a bug in the RichEditBox component, and I am wondering if anyone has a workaround to allow me to enable and disable the text without losing the color formatting. Below the example to reproduce the issue.