public override void Initialize(IComponent component)
{
// Let base class do standard stuff
base.Initialize(component);
// The resizing handles around the control need to change depending on the
// value of the AutoSize and AutoSizeMode properties. When in AutoSize you
// do not get the resizing handles, otherwise you do.
AutoResizeHandles = true;
// Cast to correct type
_dateTimePicker = component as KryptonDateTimePicker;
if (_dateTimePicker != null)
{
// Hook into date time picker events
_dateTimePicker.GetViewManager().MouseUpProcessed += new MouseEventHandler(OnDateTimePickerMouseUp);
_dateTimePicker.GetViewManager().DoubleClickProcessed += new PointHandler(OnDateTimePickerDoubleClick);
}
// Acquire service interfaces
_designerHost = (IDesignerHost)GetService(typeof(IDesignerHost));
_changeService = (IComponentChangeService)GetService(typeof(IComponentChangeService));
_selectionService = (ISelectionService)GetService(typeof(ISelectionService));
// We need to know when we are being removed
_changeService.ComponentRemoving += new ComponentEventHandler(OnComponentRemoving);
}