31-10-12, 01:10 AM
السلام عليكم...
* في سطر التلوين RichTextBox1.SelColor = vbRed ضع اللون الذي تريده بدل vbRed الذي هو اللون الأحمر.
نرجو الاستفادة و السلام.
كود :
Private Sub Command1_Click()
Dim Idx1 As Long
Dim Idx2 As Long
Dim AStart As Long
Dim TempStart As Long
Dim TempLen As Long
TempStart = RichTextBox1.SelStart
TempLen = RichTextBox1.SelLength
AStart = 0
Do While AStart < Len(RichTextBox1.Text)
Idx1 = RichTextBox1.Find("(", AStart)
If Idx1 = -1 Then
Exit Do
Else
Idx2 = RichTextBox1.Find(")", Idx1 + 1)
If Idx2 = -1 Then
Exit Do
Else
RichTextBox1.SelStart = Idx1 + 1
RichTextBox1.SelLength = Idx2 - Idx1 - 1
RichTextBox1.SelColor = vbRed ' ضع هنا اللون الذي تريده
AStart = Idx2 + 1
End If
End If
Loop
RichTextBox1.SelStart = TempStart
RichTextBox1.SelLength = TempLen
End Sub* في سطر التلوين RichTextBox1.SelColor = vbRed ضع اللون الذي تريده بدل vbRed الذي هو اللون الأحمر.
نرجو الاستفادة و السلام.
بِسْمِ اللهِ الرَّحْمَنِ الرَّحِيمِ ( وَ مَا تُقَدِّمُوا لِأَنفُسِكُم مِّنْ خَيْرٍ تَجِدُوهُ عِندَ اللهِ هُوَ خَيْراً وَ أَعْظَمَ أَجْراً ) صَدَقَ اللهُ الْعَظِيمُ
