السلام عليكــم ورحمـة الله وبركاتــه ،،
انا عندي سؤال في اداة richbox
اريد ان احدد جزء من النص الموجود في الrich boxواغير لون الخلفية بتاعة هذا الجزء المحدد
استخدمت هذا الكود لكن لا فائدة؟
[code]<FONT color=#0000ff size=2></P> if</FONT><FONT size=2> (treeView1.SelectedNode.Checked == </FONT><FONT color=#0000ff size=2>true</FONT><FONT size=2> && treeView1.SelectedNode.Text == </FONT><FONT color=#800000 size=2>"date"</FONT><FONT size=2>)</P> {</P> </FONT><FONT color=#0000ff size=2>string</FONT><FONT size=2> d = </FONT><FONT color=#800000 size=2>@"(Date.+)[^</B>](19|20)\d\d[- /.](0[1-9]|1[012]|[A-Za-z]{2,4})[- /.](0[1-9]|[12][0-9]|3[01])"</FONT><FONT size=2>;</FONT><FONT color=#008000 size=2> </P></FONT><FONT size=2> </FONT><FONT color=#008080 size=2>Regex</FONT><FONT size=2> tad = </FONT><FONT color=#0000ff size=2>new</FONT><FONT size=2> </FONT><FONT color=#008080 size=2>Regex</FONT><FONT size=2>(d);</FONT><FONT color=#008000 size=2>//tad=pat=re</P></FONT><FONT size=2> </FONT><FONT color=#008080 size=2>MatchCollection</FONT><FONT size=2> matches = tad.Matches(richTextBox1.Text);</P> </P> </FONT><FONT color=#0000ff size=2>if</FONT><FONT size=2> (matches.Count > 0)</P> {</P> </FONT><FONT color=#008000 size=2>// print out matches In List Box</P></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>for</FONT><FONT size=2> (</FONT><FONT color=#0000ff size=2>int</FONT><FONT size=2> i = 0; i < matches.Count; i++)</P> {</P> </FONT><FONT color=#008000 size=2>// = matches.ToString();</P></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>string</FONT><FONT size=2> y =richTextBox1.SelectedText = </FONT><FONT color=#008080 size=2>Color</FONT><FONT size=2>.Blue.ToString();</P> richTextBox1.Text.Replace(matches.ToString(),y);</FONT><FONT color=#008000 size=2></P></FONT> <FONT color=#008000 size=2></P></FONT><FONT size=2> }</P> }</P> </FONT><FONT color=#0000ff size=2>else</FONT><FONT size=2> </FONT><FONT color=#008080 size=2>MessageBox</FONT><FONT size=2>.Show(</FONT><FONT color=#800000 size=2>"NO Date find"</FONT><FONT size=2>);</P> </FONT>
string y =richTextBox1.SelectedText = color.Blue.ToString();richTextBox1.Text.Replace(matches.ToString(),y);
الرجااااااااء الرد في اسرع وقت((ضروري جدا)) ولكم جزيل الشكر