private void Initialize() { InitializeComponent(); if(m_Bar!=null) propertyGrid1.BrowsableAttributes=new AttributeCollection(new Attribute[] {BrowsableAttribute.Yes}); else propertyGrid1.BrowsableAttributes=new AttributeCollection(new Attribute[] {DevCoBrowsable.Yes}); propertyGrid1.CommandsVisibleIfAvailable=false; LoadResourceImages(); m_catTable=new Hashtable(20); m_GridViewSubclass=new GridViewSubclass(); m_GridViewSubclass.OnRightMouseDown+=new EventHandler(this.GridViewMouseDown); foreach(Control ctrl in propertyGrid1.Controls) { if(ctrl.GetType().ToString().IndexOf("PropertyGridView")>=0) { m_GridViewSubclass.AssignHandle(ctrl.Handle); break; } } if(m_DotNetBar!=null && !m_DotNetBar.IsDesignTime() || m_Bar!=null) { btnCancel.Visible=false; btnClose.Location=btnCancel.Location; } CreateToolbar(); RefreshView(); }
private void InitializeInternal() { propertyBars.CommandsVisibleIfAvailable=false; propertyMenus.CommandsVisibleIfAvailable=false; propertyCategories.CommandsVisibleIfAvailable=false; m_catTable=new Hashtable(20); m_GridSubclassBars=new GridViewSubclass(); m_GridSubclassBars.ParentGrid=propertyBars; m_GridSubclassBars.OnRightMouseDown+=new EventHandler(this.GridViewMouseDown); m_GridSubclassMenus=new GridViewSubclass(); m_GridSubclassMenus.ParentGrid=propertyMenus; m_GridSubclassMenus.OnRightMouseDown+=new EventHandler(this.GridViewMouseDown); m_GridSubclassCategories=new GridViewSubclass(); m_GridSubclassCategories.ParentGrid=propertyCategories; m_GridSubclassCategories.OnRightMouseDown+=new EventHandler(this.GridViewMouseDown); foreach(Control ctrl in propertyBars.Controls) { if(ctrl.GetType().ToString().IndexOf("PropertyGridView")>=0) { m_GridSubclassBars.AssignHandle(ctrl.Handle); break; } } foreach(Control ctrl in propertyMenus.Controls) { if(ctrl.GetType().ToString().IndexOf("PropertyGridView")>=0) { m_GridSubclassMenus.AssignHandle(ctrl.Handle); break; } } foreach(Control ctrl in propertyCategories.Controls) { if(ctrl.GetType().ToString().IndexOf("PropertyGridView")>=0) { m_GridSubclassCategories.AssignHandle(ctrl.Handle); break; } } }