?
Solved

Position VScrollbar on a Form contained in a TabControl

Posted on 2009-04-06
2
Medium Priority
?
241 Views
Last Modified: 2013-12-26
I need my forms vscrollbar to be at the top position.
I'm creating a new form at runtime on a new tab (tabcontrol).  My tablelayoutpanel vscrollbar is at the top position, but my forms vscrollbar position  is all the way down to expose the bottom most portion of the form.  My code:

        MyForm = New PDF_ML_Form
        MyForm.FormBorderStyle = Windows.Forms.FormBorderStyle.None
        MyForm.Dock = DockStyle.None
        MyForm.TopLevel = False
        MyForm.Anchor = AnchorStyles.Left
        MyForm.Anchor = AnchorStyles.Top
        MyForm.AutoScrollPosition = New Point(1, 1)
        Dim s As Int16 = MyForm.Width
        MyForm.Location = New Point((s - Val(PDF_ML_Form.PDF_ML_Cust_Name_txt.Text)) / 2 - 800, 4)
        MyForm.Anchor = AnchorStyles.Left
        ' Set location & size of main tab container
        MyForm.Size = New Size(MyForm.Width, PDF_ML_Form.Height + 80)
        MyForm.AutoScrollPosition = New Point(1, 1)
        myTabPage.Controls.Add(MyForm)
Thank You
0
Comment
Question by:GarySB
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 86

Accepted Solution

by:
Mike Tomlinson earned 500 total points
ID: 24079486
Try setting the AutoScrollPosition back to (0, 0) in the SHOWN() event of the Form:


Public Class YourFormHere
 
    Private Sub Form1_Shown(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Shown
        Me.AutoScrollPosition = New Point(0, 0)
    End Sub
 
End Class

Open in new window

0
 

Author Comment

by:GarySB
ID: 24080125
Its not changing the top and this is to small of a thing to take up your time with.  I'm removing the form vscrollbar and making my tablelayoutpanel smaller so it fits on a form without the need for a scroll.  Thank You
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question