Hi,
I have some issue with my custom control.
When i change my property "GridLine.Color" my custom control should
redraw its border with the specified color. However, nothing happens.
therefore based on an example from a book i implemented an eventhandler
and tried to manage it like that... but still nothing.
Here is my code example :
public class CGridLine
{
public event EventHandler PropertyChanged;
private Color m_GridLinesColor;
public Color Color
{
get
{
return this.m_GridLinesColor;
}
set
{
this.m_GridLinesColor = value;
this.OnPropertyChanged(EventArgs.Empty);
}
}
....
private void OnPropertyChanged(EventArgs e)
{
if (PropertyChanged != null)
{
PropertyChanged(this, e);
}
}
}
here is my custom control code :
....
public CGridLine GridLines
{
get
{
return this.m_GridLines;
}
set
{
this.m_GridLines = value;
if (GridLinePropertyChanged != null)
{
this.m_GridLines.PropertyChanged -= this.GridLinePropertyChanged;
}
this.GridLinePropertyChanged = new
EventHandler(GridLines.PropertyChanged);
this.m_GridLines.PropertyChanged += this.GridLinePropertyChanged;
this.Invalidate();
}
}
....
Could someone give me an example how to update during design time, the
custom control using eventhandler ?
thanks a lot,
Al.