作者MrBigTree (Mr.BigTree)
看板C_Sharp
标题[问题] 使用messagebox 导致反白消失
时间Mon Feb 10 17:10:15 2020
请问各位版友 小弟写了段程式如下
RichtextBox1.SelectionStart = nTarget;
RichtextBox1.SelectionLengh = Leangh;
RichTextBox1.Select();
反白我所要选定的文字,然而在後面加上
DialogResult result = MessageBox( “123”,MessageBoxButtons.YesNo );
会导致跳出讯息视窗的同时,要反白的文字一瞬间反白消失。
若我想让反白的文字持续反白 请问该怎麽作?
-----
Sent from JPTT on my iPhone
--
世界上分成10种人,一种是懂二进位的人,另一种是不懂二进位的
1F:推 ya1357977889: 其他8种人呢? 以为数学很烂吗 哼~08/03 00:18
2F:→ MrBigTree: 一楼真的不懂二进位...08/03 00:23
3F:→ sartrego: 一楼你是怎样… 08/03 00:53
4F:推 pauljet: 10-2=8 08/03 01:03
5F:推 Sk8erBoi: 对啊 另外8种呢 08/03 01:06
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 101.9.172.197 (台湾)
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/C_Sharp/M.1581325820.A.9EB.html
6F:→ vanchy: 是不是游标跳走了? 02/10 18:25
7F:→ vanchy: 感觉只能再选一次 02/10 18:25
8F:→ testPtt: 因为focus不在了 你再指定focus就好 02/10 19:09
9F:→ testPtt: 要持续的话可以用Leave事件指定SelectionBackColor 02/10 19:14
10F:推 Litfal: 属性HideSelection设定成False 02/10 23:09
11F:→ MrBigTree: 套用五楼的方法已解决 感谢 02/11 09:11