作者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/m.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