تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
[VB.NET] مشكلة في كود color
#1
سلام عليكم
واجهتني مشكلة في الكود ادناه
كيف  اضع colors
في كود
  RichTextBox1.SelectionColor = Color.White



وشكراً
الرد }}}
تم الشكر بواسطة:
#2
كود :
If msg.Type = MessageType.groupchat Then
    RichTextBox1.SelectionStart = RichTextBox1.Text.Length
    RichTextBox1.SelectionColor = Color.White
    RichTextBox1.AppendText(msg.From.Resource)
    RichTextBox1.SelectionColor = Color.Red
    RichTextBox1.SelectionStart = RichTextBox1.TextLength
    RichTextBox1.AppendText(" ➤ " + msg.Body & ChrW(13) & ChrW(10))
    RichTextBox1.ScrollToCaret()
End If
الرد }}}
تم الشكر بواسطة:
#3
(27-06-17, 07:19 AM)T44 كتب :
كود :
If msg.Type = MessageType.groupchat Then
   RichTextBox1.SelectionStart = RichTextBox1.Text.Length
   RichTextBox1.SelectionColor = Color.White
   RichTextBox1.AppendText(msg.From.Resource)
   RichTextBox1.SelectionColor = Color.Red
   RichTextBox1.SelectionStart = RichTextBox1.TextLength
   RichTextBox1.AppendText(" ➤ " + msg.Body & ChrW(13) & ChrW(10))
   RichTextBox1.ScrollToCaret()
End If

اين تعديل اخي
الرد }}}
تم الشكر بواسطة:
#4
PHP كود :
Dim ABCAs Integer
= (Rnd() * 255)
= (Rnd() * 255)
= (Rnd() * 255)
= (Rnd() * 255)
RichTextBox1.SelectionColor  Color.FrmoArgb(ABCD

أنصحك تستخدم الدالة التالية

PHP كود :
   Private Function BuildColor(value As Integer) As Color
        Dim red 
As Integer
        Dim green 
As Integer
        Dim blue 
As Integer
        Dim alpha 
As Integer
        red 
CInt(Math.Min(Integer.MaxValueCInt(red) + value))
 
       green CInt(Math.Min(Integer.MaxValueCInt(green) + value))
 
       blue CInt(Math.Min(Integer.MaxValueCInt(blue) + value))
 
       alpha CInt(Math.Min(Integer.MaxValueCInt(alpha) + value))
 
       Return ColorTranslator.FromOle(blue Or green Or red Or alpha)
 
   End Function 

طريقة الاستخدام

PHP كود :
Dim value As Integer 198765
        Me
.RichTextBox1.SelectionColor BuildColor(value
الرد }}}
تم الشكر بواسطة: e-coder , e-coder
#5
النتجية لون واحد فقط
الرد }}}
تم الشكر بواسطة:



التنقل السريع :


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم