Microsoft Communities

Welcome to WindowsClient.net | Sign in | Join

Here are some frequently asked questions about Windows Forms and their answers.

Windows Forms FAQs

How do I reinitialize extended provider dependencies (i.e., the logic in CanExtend) from within the designer?

Parse through all the Controls in the designer and call TypeDescriptor.Refresh() on them. From inside your custom IDesigner implementation:

private void UpdateExtendedProperties() 
{ 
  IDesignerHost idh = GetService( typeof( IDesignerHost ) ) as IDesignerHost; 
  foreach ( Component comp in idh.Container.Components ) 
  { 
    // ignore the Form 
    if ( ( comp is Control ) && ( (comp is Form ) == false ) ) 
      TypeDescriptor.Refresh(comp as Control); 
  } 
}

Contributed from George Shepherd's Windows Forms FAQ



Page view counter