Listbox en WPF

Résolu
Rapakooti Messages postés 90 Date d'inscription mercredi 4 décembre 2002 Statut Membre Dernière intervention 18 mai 2018 - Modifié le 16 mai 2018 à 22:09
Rapakooti Messages postés 90 Date d'inscription mercredi 4 décembre 2002 Statut Membre Dernière intervention 18 mai 2018 - 18 mai 2018 à 12:07
Bonjour,

Je m'essaie en WPF pour passer mon application en un style plus "moderne".

Voici à quoi elle ressemble pour l'instant


Je suis en train de me mettre au wpf et donc je joue avec les panel, stackpanel, je commence à comprendre les bases.Mais je suis bloqué avec la liste de gauche, j'ai essayé avec un dockpanel, un stackpanel elle reste petite et ne s'adapte pas à la place restant. Je la laisse vide car elle est chargé avec une requete.
Voici la nouvelle interface
.

Je vois je code WPF si vous avez une idée

<Window x:Class="WpfApp2.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:WpfApp2"
        mc:Ignorable="d"
        Title="MainWindow" Height="503.417" Width="850.18">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="71"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <StackPanel  VerticalAlignment="Top" Orientation="Horizontal" Height="70" Background="#FFF0E5E5" Grid.ColumnSpan="2">
            <Image   HorizontalAlignment="Left" Height="60" Margin="5" VerticalAlignment="Top" Width="60" Source="Properties/refresh.png"/>
            <Rectangle VerticalAlignment="Stretch" Width="1" Margin="2" Stroke="#FFA29D9D" />
            <Image   HorizontalAlignment="Left" Height="60" Margin="5" VerticalAlignment="Top" Width="60" Source="Properties/parametre.png"/>
            <Rectangle VerticalAlignment="Stretch" Width="1" Margin="2" Stroke="#FFA29D9D" />

            <Image   HorizontalAlignment="Left" Height="60" Margin="5" VerticalAlignment="Top" Width="60" Source="Properties/filtre.png"/>


        </StackPanel>
        <StackPanel Grid.Row="1" Orientation="Horizontal">
           
                <DockPanel Height="Auto"  Background="#FFF0E5E5" LastChildFill="True">



                <Border CornerRadius="8" DockPanel.Dock="Top"  Margin="3" Background="#FFF0E5E5"  BorderThickness="3" BorderBrush="#FF8D6C9F" VerticalAlignment="Top">
                    <TextBlock HorizontalAlignment="Center" Padding="3" Text="Liste des films" />
                </Border>


                
                <GroupBox  Margin="3" Height="70" Content="Actualisation" VerticalAlignment="Bottom" DockPanel.Dock="Bottom"/>
                <ListBox x:Name="listfilm" Width="120" Height="150" Margin="3" VerticalAlignment="Top" ></ListBox>
            </DockPanel>
       

        </StackPanel>


    </Grid>
</Window>




EDIT : Ajout du LANGAGE dans les balises de code (la coloration syntaxique).
Explications disponibles ici : ICI

Merci d'y penser dans tes prochains messages.

2 réponses

Whismeril Messages postés 19025 Date d'inscription mardi 11 mars 2003 Statut Contributeur Dernière intervention 19 avril 2024 656
Modifié le 16 mai 2018 à 21:34
Tu parles de la liste des films?
Si oui, c'est normal tu lui as mis une taille fixe.

<ListBox x:Name="listfilm" Width="120" Height="150" Margin="3" VerticalAlignment="Top" ></ListBox>


PS force la coloration en xml la prochaine fois.

0
Rapakooti Messages postés 90 Date d'inscription mercredi 4 décembre 2002 Statut Membre Dernière intervention 18 mai 2018
18 mai 2018 à 12:07
Bonjour, j'ai trouvé entre temps Merci.
0
Rejoignez-nous