I've created a form and displayed it inside the panel but sadly the form can't fit. So I need to use Panel.Autoscroll = True
in order to navigate the whole form.
When I click the textbox1.text
in the lowest part of the form, the panel automatically scrolls up and the textbox can't be seen. Even if I scroll down it continuously scrolls up automatically.
How can I stop it from scrolling up?
Here is my code:
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Form2.TopLevel = False
Me.Panel1.Controls.Clear()
Me.Panel1.Controls.Add(Form2)
Form2.Show()
End Sub
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
Label2.Text = Date.Now.ToString("dd/MMM/yyyy ddddddddd")
Label1.Text = Date.Now.ToString("h:mm:ss tt")
End Sub
I realized the panel scrolls up when the date text is set to the label. Is there a way to prevent this?