Bonjour,

J'ai un panel auquel j'aimerais ajouter deux ListBox ayant chacune la moitié de la hauteur du panel. Une liste occupe la moitié dau haut et l'autre liste la moitié du bas. La taille de mon panel change en fonction de la taille de la fenêtre.

Voici le constructeur de mon panel :

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
 
public MyPanel()
    {
      this.Dock = DockStyle.Fill;
 
      EnabledListBox = new CheckedListBox();
      EnabledListBox.ScrollAlwaysVisible = true;
      EnabledListBox.Dock = DockStyle.Top;
      EnabledListBox.Height = base.Size.Height / 2;
      EnabledListBox.Sorted = true;
 
      DisabledListBox = new ListBox();
      DisabledListBox.ScrollAlwaysVisible = true;
      DisabledListBox.Enabled = false;
      DisabledListBox.Dock = DockStyle.Top;
      DisabledListBox.Height = base.Size.Height / 2;
      DisabledListBoxs.Sorted = true;
 
      this.Controls.Add(DisabledListBoxs);
      this.Controls.Add(EnabledListBox);
    }
De plus, y a-t-il un moyen dae faire fonctionner la ScrollBar dans ma ListBox Disabled?

Merci de votre aide