Bonjour,
J'ai une fenêtre wpf avec 3 contrôles (2 combobox et un datePicker) comment les redimensionner ou de docker les éléments automatiquement quand l'utilisateur agrandit la fenêtre ?
Je voudrais que mes 3 contrôles restent en haut mais qu'ils prennent toute la place en horizontal.
Pour le moment les 3 controles sont dans un DockPanel, mais seul le dernier controle sur la gauche est redimensionner, est-ce que c'est possible d'avoir le même comportement mais avec les contrôles ?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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 <Window x:Class="WpfApplication1.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="350" Width="525"> <DockPanel> <ComboBox x:Name="cbRobot" HorizontalAlignment="Stretch" Margin="10,10,0,0" VerticalAlignment="Top" Width="120" Loaded="ComboBox_Loaded" SelectionChanged="ComboBox_SelectionChanged"/> <ComboBox x:Name="cbAlerte" HorizontalAlignment="Stretch" Margin="10,10,0,0" VerticalAlignment="Top" Width="120" Loaded="ComboBoxTypeALerte_Loaded" SelectionChanged="ComboBoxTypeALerte_SelectionChanged"/> <DatePicker x:Name="datePickerLog" HorizontalAlignment="Stretch" Margin="10,10,0,0" VerticalAlignment="Top" SelectedDateChanged="DatePicker_SelectedDateChanged"/> </DockPanel> </Window>
Partager