Layout problem with HBox and VBox

Ask a Question related to Macromedia Flex General Discussion, Design and Development.

  1. #1

    Default Layout problem with HBox and VBox

    I want to create a login screen that is always centered on the screen. Within
    the login screen I want two text fields to be vertically aligned and two
    corresponding text input fields to be vertically aligned. I cannot figure out
    the correct use of VBox and HBox to achieve my goal. Is there a simple way to
    think about this-- should I be using something other than VBox and HBox? The
    code below is partially correct, but the text input boxes are not vertically
    aligned.

    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
    layout="vertical"
    verticalAlign="middle">
    <mx:VBox >
    <mx:HBox >
    <mx:Label text="Username"/>
    <mx:TextInput text="test text"/>
    </mx:HBox>
    <mx:HBox >
    <mx:Label text="Password goes here"/>
    <mx:TextInput text="password"/>
    </mx:HBox>
    </mx:VBox>
    </mx:Application>

    SiHoop Guest

  2. Similar Questions and Discussions

    1. How to use HBox and VBox with States
      I'm working on an application that uses a series of states to display information in DataGrids and Panels. I want all of the information panels to...
    2. Help!...Layout Problem
      Hi everyone, Can anyone help me? I am working within Dreamweaver MX. I am creating a html page which I have added a layer into. I have...
    3. CSS Layout Problem
      Heya, So I am working on this site: http://www.hookmedia.biz/cabinet_source/v4/ and if you scroll down, in Safari and Mozilla, don't know about IE,...
    4. HBox 100% width of GridItem parent.
      Show this not create a HBox control the entire width of the GridItem it is inside? <mx:HBox backgroundColor="blue" width="100%"...
    5. hbox of vertical groups?
      In trying to align my form controls, I attempted to use an hbox formgroup to get two sets of vertical formgroups to align side-by-side. This...
  3. #2

    Default Re: Layout problem with HBox and VBox

    I think you want a form for this:

    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
    verticalAlign="middle">
    <mx:Form>
    <mx:FormItem label="Username">
    <mx:TextInput text="test text"/>
    </mx:FormItem>
    <mx:FormItem label="Password goes here">
    <mx:TextInput text="password"/>
    </mx:FormItem>
    </mx:Form>
    </mx:Application>

    Greg Lafrance Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139