public override void Initialize(IComponent component)
{
Debug.Assert(component != null);
// Validate the parameter reference
if (component == null) throw new ArgumentNullException("component");
// Let base class do standard stuff
base.Initialize(component);
// Cast to correct type
_ribbonTextBox = (KryptonRibbonGroupTextBox)component;
_ribbonTextBox.TextBoxDesigner = this;
// Update designer properties with actual starting values
Visible = _ribbonTextBox.Visible;
Enabled = _ribbonTextBox.Enabled;
// Update visible/enabled to always be showing/enabled at design time
_ribbonTextBox.Visible = true;
_ribbonTextBox.Enabled = true;
// Tell the embedded text box it is in design mode
_ribbonTextBox.TextBox.InRibbonDesignMode = true;
// Hook into events
_ribbonTextBox.DesignTimeContextMenu += new MouseEventHandler(OnContextMenu);
// Get access to the services
_designerHost = (IDesignerHost)GetService(typeof(IDesignerHost));
_changeService = (IComponentChangeService)GetService(typeof(IComponentChangeService));
// We need to know when we are being removed/changed
_changeService.ComponentChanged += new ComponentChangedEventHandler(OnComponentChanged);
}