[CLOSED] Label width problem

  1. #1

    [CLOSED] Label width problem

    How can set width for a label of a text field, i use labelWidth but it doesn't work. In the next example(show image) i want to reduce label width because text field is to small.

     
             <ext:FormPanel ID="FormPanel1" runat="server" Layout="Column" Header="false" Border="false" Width="300" Height="30" >
                <Items>
                    <ext:Panel ID="Panel1" runat="server" ColumnWidth=".5" Layout="Form" Border="false">
                        <Items>
                            <ext:TextField ID="txtUser" ColumnWidth=".5" runat="server" Cls="Login_Input" 
                                AllowBlank="false" AnchorHorizontal="92%" FieldLabel="User" ></ext:TextField> 
                        </Items>
                    </ext:Panel>
                    <ext:Panel ID="Panel2" runat="server" ColumnWidth=".5" Layout="Form" Border="false">
                        <Items>
                            <ext:TextField ID="txtPass" ColumnWidth=".5" runat="server" Cls="Login_Input" 
                                InputType="Password" AllowBlank="false" AnchorHorizontal="92%" FieldLabel="User" ></ext:TextField>
                        </Items>
                    </ext:Panel>
                </Items>
            </ext:FormPanel>
    Attached Thumbnails Click image for larger version. 

Name:	LabelProblem.jpg 
Views:	223 
Size:	57.9 KB 
ID:	2226  
    Last edited by Daniil; Jan 22, 2011 at 4:06 PM. Reason: [CLOSED]
  2. #2
    Hi,

    You can set the .LabelWidth property of the Container which holds the Fields. In your case, it would be Panel1 and Panel2.

    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>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
            
            <ext:FormPanel 
                ID="FormPanel1" 
                runat="server" 
                Layout="Column" 
                Header="false" 
                Border="false" 
                Width="300" 
                Height="30">
                <Items>
                    <ext:Panel 
                        ID="Panel1" 
                        runat="server" 
                        ColumnWidth=".5" 
                        Layout="Form" 
                        Border="false"
                        LabelWidth="50">
                        <Items>
                            <ext:TextField 
                                ID="txtUser" 
                                ColumnWidth=".5" 
                                runat="server" 
                                Cls="Login_Input"
                                AllowBlank="false" 
                                AnchorHorizontal="92%" 
                                FieldLabel="User" 
                                />
                        </Items>
                    </ext:Panel>
                    <ext:Panel 
                        ID="Panel2" 
                        runat="server" 
                        ColumnWidth=".5" 
                        Layout="Form" 
                        Border="false"
                        LabelWidth="50">
                        <Items>
                            <ext:TextField 
                                ID="txtPass" 
                                ColumnWidth=".5" 
                                runat="server" 
                                Cls="Login_Input"
                                InputType="Password" 
                                AllowBlank="false" 
                                AnchorHorizontal="92%" 
                                FieldLabel="User"
                                />
                        </Items>
                    </ext:Panel>
                </Items>
            </ext:FormPanel>
        </form>
    </body>
    </html>
    Hope this helps.
    Geoffrey McGill
    Founder
  3. #3
    It works thanks

Similar Threads

  1. [CLOSED] Label width ignored on NumberField
    By machinableed in forum 2.x Legacy Premium Help
    Replies: 4
    Last Post: Aug 28, 2012, 5:05 AM
  2. label width
    By bilgecooliteforum in forum 1.x Help
    Replies: 1
    Last Post: May 13, 2010, 11:58 AM
  3. [CLOSED] Field Label Width of Composite Fields
    By jeremyl in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: May 11, 2010, 5:32 AM
  4. [CLOSED] ext:Label width/alignment in Anchor
    By mrozik in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Dec 28, 2009, 10:14 AM
  5. Multifield label width
    By Wtower in forum 1.x Help
    Replies: 2
    Last Post: Aug 10, 2009, 1:37 PM

Tags for this Thread

Posting Permissions