[CLOSED] Modify window colour dynamically

  1. #1

    [CLOSED] Modify window colour dynamically

    Hi,

    I'd like to be able to, via javascript if possible, modify the colour of a window titlebar. Ideally I'd like the window titlebar (where the window text is) to be red, for example. I've found a few samples but none which manage the title bar colour.

    I'd like to be able to change this back and forward (depending on certain conditions) from the default style and my style (red).

    Thanks
    Last edited by Daniil; Jan 27, 2012 at 9:36 AM. Reason: [CLOSED]
  2. #2
    Hi,

    Here you are.

    Example
    <%@ Page Language="C#" %>
     
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Ext.NET Example</title>
    
        <script type="text/javascript">
            var toggle = function (win) {
                win.el.toggleClass("my-color");
            };
        </script>
    
        <style type="text/css">
            .my-color .x-window-tc, .my-color .x-window-tr, .my-color .x-window-tl {
                background-image: none;
                background-color: red;
            }
        </style>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
            <ext:Window ID="Window1" runat="server" Title="Title" />
            <ext:Button runat="server" Text="Toogle">
                <Listeners>
                    <Click Handler="toggle(Window1);" />
                </Listeners>
            </ext:Button>
        </form>
    </body>
    </html>
  3. #3
    Perfect, thank you so much.

Similar Threads

  1. Create new window dynamically on button click from another window
    By softlabsgroup.support in forum 1.x Help
    Replies: 6
    Last Post: May 01, 2012, 9:26 AM
  2. Replies: 0
    Last Post: Mar 27, 2012, 10:01 AM
  3. Replies: 8
    Last Post: Mar 13, 2012, 5:54 PM
  4. [CLOSED] Treegrid - row highlight colour
    By fordprefect in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Sep 30, 2011, 8:27 PM
  5. change button colour
    By RS in forum 1.x Help
    Replies: 0
    Last Post: Jan 30, 2009, 9:03 AM

Posting Permissions