none
[WPF, .NET] Construção de layout diferente RRS feed

  • Pergunta

  • E aí, pessoal!

    Queria fazer esse formulário com WPF. Alguém tem ideia de por onde posso começar?

    Valeu, abraços!

    quinta-feira, 23 de fevereiro de 2012 18:59

Respostas

  • Veja se é mais ou menos o que você precisa.

    <Window x:Class="Layout.MainWindow"
            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            Title="MainWindow" Height="Auto" Width="Auto">
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>
            
            <Grid Name="gridLeft" Grid.Column="0">
                
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="*" />
                </Grid.RowDefinitions>
                
                <TextBlock Text="Nome:" Grid.Row="0" Margin="5" />
                <TextBox Grid.Row="1" Margin="5 0 5 0" />
    
                <TextBlock Text="Tempo de execução:" Grid.Row="2" Margin="5" />
                <TextBox Grid.Row="3" Margin="5 0 5 0" />
    
                <TextBlock Text="Alcance:" Grid.Row="4" Margin="5" />
                <TextBox Grid.Row="5" Margin="5 0 5 0" />
    
                <TextBlock Text="Alvo:" Grid.Row="6" Margin="5" />
                <TextBox Grid.Row="7" Margin="5 0 5 0" />
    
                <TextBlock Text="Descrição:" Grid.Row="8" Margin="5" />
                <TextBox Grid.Row="9" Margin="5 0 5 5" />
    
            </Grid>
            
            <Grid Name="gridRight" Grid.Column="1">
                
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="*" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="*" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="*" />
                </Grid.RowDefinitions>
                
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>
                
                <TextBlock Text="Componentes" VerticalAlignment="Center" Grid.Column="0" Grid.Row="0" Margin="5" />
                <Button Content="..." MinWidth="30" HorizontalAlignment="Right" Grid.Column="1" Grid.Row="0" Margin="5" />
                <ListBox Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="1">
                    <ListBoxItem>[V] Verbal</ListBoxItem>
                    <ListBoxItem>[G] Gestual</ListBoxItem>
                    <ListBoxItem>[M] Manual</ListBoxItem>
                </ListBox>
                
                <TextBlock Text="Classes" VerticalAlignment="Center" Grid.Column="0" Grid.Row="2" Margin="5" />
                <Button Content="..." MinWidth="30" HorizontalAlignment="Right" Grid.Column="1" Grid.Row="2" Margin="5" />
                <ListBox Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="3">
                    <ListBoxItem>Item 1</ListBoxItem>
                    <ListBoxItem>Item 2</ListBoxItem>
                </ListBox>
    
                <TextBlock Text="Componentes" VerticalAlignment="Center" Grid.Column="0" Grid.Row="4" Margin="5" />
                <Button Content="..." MinWidth="30" HorizontalAlignment="Right" Grid.Column="1" Grid.Row="4" Margin="5" />
                <TextBox Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="5" Margin="5" />
                
            </Grid>
            
        </Grid>
    </Window>
    


    quinta-feira, 23 de fevereiro de 2012 21:53

Todas as Respostas

  • Veja se é mais ou menos o que você precisa.

    <Window x:Class="Layout.MainWindow"
            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            Title="MainWindow" Height="Auto" Width="Auto">
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>
            
            <Grid Name="gridLeft" Grid.Column="0">
                
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="*" />
                </Grid.RowDefinitions>
                
                <TextBlock Text="Nome:" Grid.Row="0" Margin="5" />
                <TextBox Grid.Row="1" Margin="5 0 5 0" />
    
                <TextBlock Text="Tempo de execução:" Grid.Row="2" Margin="5" />
                <TextBox Grid.Row="3" Margin="5 0 5 0" />
    
                <TextBlock Text="Alcance:" Grid.Row="4" Margin="5" />
                <TextBox Grid.Row="5" Margin="5 0 5 0" />
    
                <TextBlock Text="Alvo:" Grid.Row="6" Margin="5" />
                <TextBox Grid.Row="7" Margin="5 0 5 0" />
    
                <TextBlock Text="Descrição:" Grid.Row="8" Margin="5" />
                <TextBox Grid.Row="9" Margin="5 0 5 5" />
    
            </Grid>
            
            <Grid Name="gridRight" Grid.Column="1">
                
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="*" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="*" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="*" />
                </Grid.RowDefinitions>
                
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>
                
                <TextBlock Text="Componentes" VerticalAlignment="Center" Grid.Column="0" Grid.Row="0" Margin="5" />
                <Button Content="..." MinWidth="30" HorizontalAlignment="Right" Grid.Column="1" Grid.Row="0" Margin="5" />
                <ListBox Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="1">
                    <ListBoxItem>[V] Verbal</ListBoxItem>
                    <ListBoxItem>[G] Gestual</ListBoxItem>
                    <ListBoxItem>[M] Manual</ListBoxItem>
                </ListBox>
                
                <TextBlock Text="Classes" VerticalAlignment="Center" Grid.Column="0" Grid.Row="2" Margin="5" />
                <Button Content="..." MinWidth="30" HorizontalAlignment="Right" Grid.Column="1" Grid.Row="2" Margin="5" />
                <ListBox Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="3">
                    <ListBoxItem>Item 1</ListBoxItem>
                    <ListBoxItem>Item 2</ListBoxItem>
                </ListBox>
    
                <TextBlock Text="Componentes" VerticalAlignment="Center" Grid.Column="0" Grid.Row="4" Margin="5" />
                <Button Content="..." MinWidth="30" HorizontalAlignment="Right" Grid.Column="1" Grid.Row="4" Margin="5" />
                <TextBox Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="5" Margin="5" />
                
            </Grid>
            
        </Grid>
    </Window>
    


    quinta-feira, 23 de fevereiro de 2012 21:53
  • Obrigado, Paulo Afonso!

    Não sabia que o layout grid era tão versátil assim! É exatamente isso que eu precio. Muito obrigado pela resposta.

    Abraços, até mais!

    sexta-feira, 24 de fevereiro de 2012 10:16