I have an application that has hundreds of controls and tooltips for each control. What I'm trying to do is create a "smart" TextBox control that during design time, I can specify the tooltip, which actually points to a value in a hashtable so when the control loads, it can go get it's tooltip. I'm running into a couple of issues while trying to do this:
1. I created an Interface that all my forms/controls will derive from so I can be sure the Parent where my smart TextBox lives implements the functions I need. This creates an issue though, if I drop my smart text box on a form, have the form derive from my interface and then try to open the form up in design mode, it fails because I'm casting the "Parent" to my interface. It fails here:
protected override void OnLayout(LayoutEventArgs levent)
IFormBase ctrl = this.Parent as IFormBase; //This causes the error.
ToolTip tt = ctrl.GetToolTipCtrl();
2. I have a checkbox on my form that switches between units of measure. In the OnChanged event, I need to refresh my smart text box so it will bring back the tooltip with the correct units specified. Is there some kind of Invalidate method I can call on the form that will cause all the controls to update themselves?
I've uploaded my sample project file, any guidance would be greatly appreciated.