[CLOSED] [1.0] Window/Component Styles

  1. #1

    [CLOSED] [1.0] Window/Component Styles

    Hi, I understand that I can Theme an entire application but how would I create different coloured windows? For example, I'm using the standard blue theme but for certain windows in my app I require one window to be red and another to be blue. How would I achieve this?

    Any help would be great.

    Thanks,

    Gav
    Last edited by geoffrey.mcgill; Nov 24, 2010 at 3:10 PM. Reason: [CLOSED]
  2. #2
    Hi,

    It needs to override css rules. I would suggest you to use Cls property.

    Here is a simple example which will help you to start.

    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>
    
        <style type="text/css">
            .red-window div.x-window-body {
                background-color: Red;
            }
            .blue-window div.x-window-body {
                background-color: Blue;
            }
        </style>
    </head>
    <body>
        <form runat="server">
        <ext:ResourceManager runat="server" />
        <ext:Window 
            runat="server" 
            Title="Red" 
            Cls="red-window" 
            X="50" 
            Y="50" />
        <ext:Window runat="server" Title="Blue" Cls="blue-window" />
        </form>
    </body>
    </html>
  3. #3
    Thanks Daniil, this is a suitable solution for me. Two things; is there a reference document with the list of all the classes I need to create css for somewhere? Also, when creating a Window component dynamically using code-behind which property do I used to specify the Cls as I can't seem to find it anywhere?

    Any info would be great.

    Thanks,

    Gav
  4. #4
    Quote Originally Posted by GavinR View Post
    is there a reference document with the list of all the classes I need to create css for somewhere?
    I'm not sure such reference exists...

    Personally, I use IE Developer tools or FF FireBug to inspect css/classes rules, after that I dynamically change them trying to get an expected result. Then I add resulting rules on a page.

    Quote Originally Posted by GavinR View Post
    Also, when creating a Window component dynamically using code-behind which property do I used to specify the Cls as I can't seem to find it anywhere?
    There is the Cls property.

    Example
    var win = new Ext.Net.Window() { Cls = "myClass" };
    or
    var win = new Ext.Net.Window();
    win.Cls = "myClass";
    Last edited by Daniil; Nov 24, 2010 at 2:33 PM.
  5. #5
    Thanks Daniil.

Similar Threads

  1. Replies: 2
    Last Post: Jul 26, 2012, 2:12 AM
  2. Replies: 0
    Last Post: Jun 13, 2012, 8:47 AM
  3. Replies: 2
    Last Post: Apr 21, 2012, 10:15 AM
  4. [CLOSED] [1.0] ext window control and styles
    By betamax in forum 1.x Legacy Premium Help
    Replies: 21
    Last Post: Jul 29, 2010, 8:33 PM
  5. [CLOSED] Desktop Window | Toolbar | Dropdownfield Component
    By amitpareek in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Feb 01, 2010, 3:49 PM

Tags for this Thread

Posting Permissions