Hey
Auf meinem Formular habe ich ein Panel mit einer variierenden Anzahl von Buttons. Sie sind alle in einer Reihe angeordnet und sind alle auf dock top festgelegt. Da ich das Design der mitgelieferten Scrollbars und die fehlende Möglichkeit, die Farbe zu ändern, nicht mag, habe ich meine eigene Scrollbar erstellt, die super funktioniert. Das Problem besteht darin, dass AutoScroll auf True festgelegt sein muss, damit es funktioniert. Wenn die summierte Höhe des Inhalts die Höhe des Fensters überschreitet, wird automatisch die Standard-Bildlaufleiste angezeigt, und ich kann sie nicht ausblenden.
Ich habe schon alles probiert
1. Beispiel:
C#-Quelltext
1: 2: 3: 4: 5: 6:
| this.panel_Playlists.AutoScroll = false; this.panel_Playlists.HorizontalScroll.Enabled = false; this.panel_Playlists.HorizontalScroll.Visible = false; this.panel_Playlists.VerticalScroll.Enabled = false; this.panel_Playlists.VerticalScroll.Visible = false; this.panel_Playlists.AutoScroll = true; |
2. Beispiel:
C#-Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17:
| public enum ScrollBarDirection { SB_HORZ = 0, SB_VERT = 1, SB_CTL = 2, SB_BOTH = 3 }
[DllImport("user32.dll")] [return: MarshalAs(UnmanagedType.Bool)] private static extern bool ShowScrollBar(IntPtr hWnd, int wBar, bool bShow);
protected override void WndProc(ref Message m) { ShowScrollBar(panel_Playlists.Handle, (int)ScrollBarDirection.SB_BOTH, false); base.WndProc(ref m); } |
Egal was ich versuche nichts funktioniert. Entweder flackert die Scrollbar oder sie ist dauerhaft zu sehen.
Bitte um schnelle Hilfe.
LG Kasko