I want to make my own control, inheriting from GroupBox.
Ive followed instructions in here, and that's the result of the implementation:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace GeneralUserControls
{
public partial class MyGroupBox : GroupBox
{
public MyGroupBox ()
{
InitializeComponent();
}
protected override void OnPaint(PaintEventArgs pe)
{
base.OnPaint(pe);
}
}
}
But when I try to use it this way:
<Window [...]
xmlns:guc="clr-namespace:GeneralUserControls;assembly=GeneralUserControls" >
[...
<guc:MyGroupBox Header="Etiquette :" Width="70" Height="70">
<Grid>
[...]
</Grid>
</guc:MyGroupBox>
It seems to not consider it as a groupbox! Here are the errors:
Error 1 The property 'Header' was not found in type 'MyGroupBox'.
Error 2 The type 'MyGroupBox' does not support direct content.
Error 3 Cannot add content to an object of type "MyGroupBox".
Error 9 Cannot add content to object of type 'GeneralUserControls.MyGroupBox'.
Any idea?