AppearanceEditorPart Chromestate

Last post 09-29-2004 2:17 AM by Fredrik N. 1 replies.

Sort Posts:

  • AppearanceEditorPart Chromestate

    09-28-2004, 4:49 PM
    • Member
      275 point Member
    • optionDK
    • Member since 06-24-2004, 6:31 PM
    • Denmark
    • Posts 55
    Hi -

    Does any of you have knowledge about AppearanceEditorPart and Chromestate?

    When in VS2005 designmode it is possible to set the Chromestate to minimized and it works when page is displayed when run, the AppearaceEditorPart starts out minimized... but how can the user maximize the Chromestate again giving him the possibilities to change settings ????

    I have gone through Help and the net ... nothing!
    Best regards


    Henrik Sørensen, OPTION APS Denmark
  • Re: AppearanceEditorPart Chromestate

    09-29-2004, 2:17 AM
    • All-Star
      29,644 point All-Star
    • Fredrik N
    • Member since 06-22-2002, 5:03 AM
    • Sweden
    • Posts 5,334
    • TrustedFriends-MVPs
    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>&nbsp;
    <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 @ twitter

    ASPInsider

    Microsoft MVP, MCSD, MCAD, MCT

    ASPInsiders
    My Blog
Page 1 of 1 (2 items)