水平滚动条未显示在面板中

时间:2016-01-21 21:28:47

标签: vb.net panel scrollbars

我创建了一个尺寸为500 x 500的简单面板。我还创建了另一个尺寸为1000 x 10的面板(inner_panel)。我将其设置在第一个面板内。但是,第一个面板不显示任何滚动条。我已经尝试将自动滚动设置为true,但这并没有帮助。如何让外面板上的水平滚动条显示?

Public Class test_panel

    Inherits Panel

    Private outer_panel As New Panel()
    Private inner_panel As New Panel()

    Public Sub New()

        With outer_panel
            .Parent = Me
            .Width = 500
            .Height = 500
            .BackColor = Color.Green
            .Location = New Point(0, 0)
            .AutoScroll = True
        End With

        With inner_panel
            .Parent = outer_panel
            .Width = 1000
            .Height = 10
            .BackColor = Color.Red
            .Location = New Point(0, 0)
        End With

    End Sub

End Class

0 个答案:

没有答案