Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vb.net/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Vb.net 自动滚动在tabcontrol中不工作_Vb.net_Autoscroll - Fatal编程技术网

Vb.net 自动滚动在tabcontrol中不工作

Vb.net 自动滚动在tabcontrol中不工作,vb.net,autoscroll,Vb.net,Autoscroll,从下面的屏幕截图可以看出,我的autoscroll无法工作。选项卡中有一个tablelayoutpanel,两个选项卡上的autoscroll都设置为true,但都不起作用 正如这个问题所暗示的,我尝试摆脱Dock.Fill(我的停靠现在通过设计器设置为“无”),但这也不起作用 当添加新问题时,我能做些什么让它向下滚动,有什么建议吗 我在case语句中尝试以下代码,当我对问题D回答yes时,它只显示0,0作为autoscroll的位置,而不向下移动它 Case "DY"

从下面的屏幕截图可以看出,我的autoscroll无法工作。选项卡中有一个tablelayoutpanel,两个选项卡上的autoscroll都设置为true,但都不起作用

正如这个问题所暗示的,我尝试摆脱Dock.Fill(我的停靠现在通过设计器设置为“无”),但这也不起作用

当添加新问题时,我能做些什么让它向下滚动,有什么建议吗

我在case语句中尝试以下代码,当我对问题D回答yes时,它只显示0,0作为autoscroll的位置,而不向下移动它

        Case "DY"
            Dim q As KeyValuePair(Of String, String)
            For Each q In Questions
                If q.Key = "E" Then
                    For Each c As Control In Appl1HealthQuestions.Controls
                        ShowControls(15, 16, 17, cbo)
                    Next
                    Appl1TabScrollLayout.AutoScroll = True
                    Appl1TabScrollLayout.AutoScrollPosition = New Point(Me.AutoScrollPosition.X, Me.AutoScrollPosition.Y - 20)
                    MessageBox.Show(Applicant1Tab.AutoScrollPosition.ToString)
                    MessageBox.Show(Appl1TabScrollLayout.AutoScrollPosition.ToString)
                    Exit For
                End If
            Next

我找到了一个解决方案:

Case "DY"
        Dim q As KeyValuePair(Of String, String)
        For Each q In Questions
            If q.Key = "E" Then
                For Each c As Control In Appl1HealthQuestions.Controls
                    ShowControls(15, 16, 17, cbo)
                Next
                Appl1TabScrollLayout.VerticalScroll.Value = Appl1TabScrollLayout.VerticalScroll.Maximum
                Exit For
            End If
        Next

VerticalScroll.Maximum将滚动移动到显示新控件的窗口底部,这正是我想要的。

它位于选项卡页yes中,但不在groupbox中。不过我有嵌套的tablelayoutpanels。我在代码中引用的是“主”面板,显示问题和组合框的面板是主面板中的另一个tablelayoutpanel。