You can change the ChromeState (but must be done after the value of the ChromseState property is set). If you change is programmatically before the property of the control is set, the ChromeState will not be changed because the value you have specified for the control will override the value you have specified. You have to change it programmatically after the Page_Load event, for example when a button's click event is trigged or in the Page_preRender etc.
Here is an example:
<%@ Page Language="C#" %>
<script runat=Server>
void Button2_Click(object sender, EventArgs e)
{
((AppearanceEditorPart)EditorZone1.EditorParts[0]).ChromeState = PartChromeState.Normal;
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:WebPartManager ID="WebPartManager1" Runat="server">
</asp:WebPartManager>
<asp:WebPartZone ID="WebPartZone1" Runat="server">
<ZoneTemplate>
<asp:Button Runat="server" Text="Button" ID="Button1" />
</ZoneTemplate>
</asp:WebPartZone>
<asp:EditorZone ID="EditorZone1" Runat="server">
<ZoneTemplate>
<asp:AppearanceEditorPart Runat="server" ID="AppearanceEditorPart1" ChromeState="Minimized" />
</ZoneTemplate>
</asp:EditorZone>
<asp:WebPartPageMenu ID="WebPartPageMenu1" Runat="server">
</asp:WebPartPageMenu>
<asp:Button ID="Button2" Runat="server" Text="Change ChromeState to normal" OnClick="Button2_Click" />
</div>
</form>
</body>
</html>
/Fredrik Normén -
fredrikn @ twitterASPInsider
Microsoft MVP, MCSD, MCAD, MCT
ASPInsidersMy Blog