0

My application UI use Tab control.
One of the tab has 20 groupboxes (in scrollviwer), and each groupbox contents 300 textbox with a name (label) above the textbox (not one on one match). When the app running (not yet), each textbox will display a byte value from the buffer. I am manually drawing this groupbox, it is too much work. I am trying use itemcontrol to draw the textboxes, but don't know how to make a new line since there are name-value pair.

Any solution will be appreciated.

4

1 回答 1

0

您可以将 ItemControl 与 DataTemplate 一起使用,其中 DataTemplate 表示一个键值对。

              <ItemsControl>
                <ItemsControl.ItemTemplate>
                    <DataTemplate>
                        <StackPanel Orientation="Horizontal">
                           <TextBlock Text="Hi I am a label" />
                           <TextBox />
                        </StackPanel>
                    </DataTemplate>
                </ItemsControl.ItemTemplate>
            </ItemsControl>
于 2013-07-11T19:15:17.683 回答