منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب

نسخة كاملة : مشكلة في كود color
أنت حالياً تتصفح نسخة خفيفة من المنتدى . مشاهدة نسخة كاملة مع جميع الأشكال الجمالية .
سلام عليكم
واجهتني مشكلة في الكود ادناه
كيف  اضع colors
في كود
  RichTextBox1.SelectionColor = Color.White



وشكراً
كود :
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
(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

اين تعديل اخي
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
النتجية لون واحد فقط