0
Reply

Scroll strange behavior

Nicolae Chiran

Nicolae Chiran

Jan 28 2008 8:45 AM
2.1k

Hi! Please help with something!

I have a form with Autoscroll = true. I added a control (e.g. Button) and I reduced the form size until the added control couldn't be seen. When I run the application, the form is scrolling until the control is visible. I find this behavior strange, I want that the form start its visible area with its (0, 0) point, not to do this scroll.

Bellow I attached the code of "Form1.Designer.vb" file:

<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _

Partial Class Form1

Inherits System.Windows.Forms.Form

'Form overrides dispose to clean up the component list.

<System.Diagnostics.DebuggerNonUserCode()> _

Protected Overrides Sub Dispose(ByVal disposing As Boolean)

If disposing AndAlso components IsNot Nothing Then

components.Dispose()

End If

MyBase.Dispose(disposing)

End Sub

'Required by the Windows Form Designer

Private components As System.ComponentModel.IContainer

'NOTE: The following procedure is required by the Windows Form Designer

'It can be modified using the Windows Form Designer.

'Do not modify it using the code editor.

<System.Diagnostics.DebuggerStepThrough()> _

Private Sub InitializeComponent()

Me.Button1 = New System.Windows.Forms.Button

Me.SuspendLayout()

'

'Button1

'

Me.Button1.Location = New System.Drawing.Point(654, 547)

Me.Button1.Name = "Button1"

Me.Button1.Size = New System.Drawing.Size(75, 23)

Me.Button1.TabIndex = 0

Me.Button1.Text = "Button1"

Me.Button1.UseVisualStyleBackColor = True

'

'Form1

'

Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)

Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font

Me.AutoScroll = True

Me.ClientSize = New System.Drawing.Size(540, 271)

Me.Controls.Add(Me.Button1)

Me.Name = "Form1"

Me.Text = "Form1"

Me.ResumeLayout(False)

End Sub

Friend WithEvents Button1 As System.Windows.Forms.Button

End Class

I want to specify that I use VS.NET 2005 with .NET Framework 2.

Thank you!

Nick