Bonjour
Tu peux toujours redéfinir ton propre group box, et en surchargeant la methode OnPaint faire ce que tu veux du Texte
ex:
public class MyGroupBox : GroupBox
{
public MyGroupBox():base()
{
base.Text = string.Empty;
}
string _text;
public override string Text
{
get
{
return _text;
}
set
{
base.Text = string.Empty;
_text = value;
}
}
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
using (Font titlefont = new Font(this.Font, FontStyle.Bold))
{
SolidBrush backBrush= new SolidBrush(this.BackColor);
SizeF TitelSize = e.Graphics.MeasureString("Titre: ", titlefont);
SizeF TextSize = e.Graphics.MeasureString(_text , this.Font);
e.Graphics.FillRectangle(backBrush, new RectangleF(new Point(5, 0), TitelSize));
e.Graphics.FillRectangle(backBrush, new RectangleF(new Point(5+(int)TitelSize.Width, 0), TextSize));
e.Graphics.DrawString("Titre: ", titlefont, Brushes.Black, 5, 0);
e.Graphics.DrawString(_text, this.Font, Brushes.BlueViolet, 5+TitelSize.Width,0);
backBrush.Dispose();
}
}
}
Bob.
C# is amazing, enjoy it!