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

نسخة كاملة : (تم الحل) كيف يمكن تلوين الإطار الخاص بـ Groupbox ؟
أنت حالياً تتصفح نسخة خفيفة من المنتدى . مشاهدة نسخة كاملة مع جميع الأشكال الجمالية .
السلام عليكم

أريد تلوين الإطار الخاص بـ Groupbox فكيف يمكن عمل ذلك لأننى لم أجد أى خاصية تتعلق بـ Style or Border ؟؟؟؟
وعليكم السلام

إستخدم الأمر التالي في حدث OnPoint للـ GroupBox
كود :
Dim tSize As Size = TextRenderer.MeasureText(GroupBox1.Text, GroupBox1.Font)
        Dim borderRect As Rectangle = e.ClipRectangle
        borderRect.Y = (borderRect.Y _
                    + (tSize.Height / 2))
        borderRect.Height = (borderRect.Height _
                    - (tSize.Height / 2))
        ControlPaint.DrawBorder(e.Graphics, borderRect, Color.Blue, ButtonBorderStyle.Solid)
        Dim textRect As Rectangle = e.ClipRectangle
        textRect.X = (textRect.X + 6)
        textRect.Width = tSize.Width
        textRect.Height = tSize.Height
        e.Graphics.FillRectangle(New SolidBrush(Me.BackColor), textRect)
        e.Graphics.DrawString(GroupBox1.Text, GroupBox1.Font, New SolidBrush(GroupBox1.ForeColor), textRect)