Maybe you're looking for AllowHide property? :)
Update: I was able to hide a ContentEditorWebPart in my SharePoint 2010 environment. Maybe this may help you, here is the full list of properties of the webpart.
ContentLink : Content : Content PartStorage : ContentHasToken : False Title : Content Editor FrameType : Default SuppressWebPartChrome : False Description : Allows authors to enter rich text content. IsIncluded : True ZoneID : Left PartOrder : 0 FrameState : Normal Height : Width : AllowRemove : True AllowZoneChange : True AllowMinimize : True AllowConnect : True AllowEdit : True AllowHide : True IsVisible : True Hidden : False CatalogIconImageUrl : /_layouts/images/mscontl.gif TitleIconImageUrl : TitleUrl : DetailLink : HelpUrl : HelpLink : HelpMode : Modeless Dir : Default PartImageSmall : MissingAssembly : Cannot import this Web Part. ImportErrorMessage : Cannot import this Web Part. PartImageLarge : /_layouts/images/mscontl.gif IsIncludedFilter : AuthorizationFilter : ExportControlledProperties : True ConnectionID : 00000000-0000-0000-0000-000000000000 ID : g_7762e716_abae_47f1_a4f6_fcafe0411f83 StorageKey : 7762e716-abae-47f1-a4f6-fcafe0411f83 Connections : UnknownXmlElements : {} SerializedAttachedPropertiesShared : SerializedAttachedPropertiesUser : CssStyleSheet : UseDefaultStyles : True Qualifier : ClientName : varPart Caption : Subtitle : Permissions : PersonalProperties BrowserDesignMode : False EffectiveTitle : Content Editor EffectiveStorage : Personal EffectiveFrameType : Standard AllowClose : True ChromeState : Normal ChromeType : Default ConnectErrorMessage : Direction : NotSet DisplayTitle : Content Editor ExportMode : All HasUserData : True HasSharedData : False IsClosed : False IsShared : True IsStandalone : False IsStatic : False Verbs : {} WebBrowsableObject : Microsoft.SharePoint.WebPartPages.ContentE ditorWebPart Zone : ZoneIndex : 0 Controls : {} BackImageUrl : DefaultButton : GroupingText : HorizontalAlign : NotSet ScrollBars : None Wrap : True AccessKey : Attributes : System.Web.UI.AttributeCollection BackColor : Color [Empty] BorderColor : Color [Empty] BorderWidth : BorderStyle : NotSet ControlStyle : System.Web.UI.WebControls.PanelStyle ControlStyleCreated : True CssClass : Style : System.Web.UI.CssStyleCollection Enabled : True EnableTheming : True Font : ForeColor : Color [Empty] HasAttributes : False SkinID : TabIndex : 0 ToolTip : ClientID : g_7762e716_abae_47f1_a4f6_fcafe0411f83 EnableViewState : True NamingContainer : BindingContainer : Page : TemplateControl : Parent : TemplateSourceDirectory : AppRelativeTemplateSourceDirectory : Site : Visible : True UniqueID : g_7762e716_abae_47f1_a4f6_fcafe0411f83
And here is the PowerShell code I used (it's actually similar to yours C#, I don't see any difference, as soon PowerShell simply calls SharePoint object model):
$w = Get-SPWeb http://localhost $wpm = $w.GetLimitedWebPartManager("default.aspx", [System.Web.UI.WebControls.WebParts.PersonalizationScope]::User); $wpm.WebParts[3].Hidden = $true $wpm.SaveChanges($wpm.Webparts[3]);