开发者

Images issue in WinForms RichTextBox

开发者 https://www.devze.com 2023-03-01 13:30 出处:网络
I have an application that writes text with image asynchronously to the RixhTextBox. All works fine, except when i minimize window then restore it to check progress and all images after minimizing and

I have an application that writes text with image asynchronously to the RixhTextBox. All works fine, except when i minimize window then restore it to check progress and all images after minimizing and before restoring are not floated to the next line. It looks like this:

Images issue in WinForms RichTextBox

Red line shows what happened while window was minimized. Code that inserts text:

txtLog.AppendText(" ");
txtLog.InsertImage(Resources.OK);
txtLog.AppendText(" " + message + Environment.NewLine);

Dont understand what difference between minimized\maximized writing to RTB and how to开发者_高级运维 resolve this.


ExRichTextBox.InsertImage states 'image is inserted wherever the caret is.' RichTextBox.AppendText doesn't, however.

Put debug logic to see if txtLog.SelectionStart is changing when minimized. If not - try forcing it

Edit: Good to hear it worked

0

精彩评论

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

关注公众号