Hey all i have the following code sliding from the bottom of the main form position to the middle of the main form.
main form
Dim Viewform2 As New Form2
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.AddOwnedForm(Viewform2)
Viewform2.Show()
Call ChangeChildFormLayout()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim intX As Integer = Me.Top + Me.Height
Dim opacityNum As Short = 0
Dim slideTo As Integer = Me.Top + Me.Height - 210
Do Until intX = slideTo
With Viewform2
.TopMost = True
.Opacity = intX
.Top = intX
.Height = 220
.Left = Me.Left
.Width = Me.Width
End With
Debug.Print(intX)
intX -= 1
If opacityNum <> 101 Then
opacityNum += 1
End If
Application.DoEvents()
Loop
End Sub
Private Sub Form1_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Resize
Call ChangeChildFormLayout()
End Sub
Private Sub ChangeChildFormLayout()
With Viewform2
.Opacity = 0
.Top = Me.Top + Me.Height
.Height = 200
.Left = Me.Left
.Width = Me.Width
End With
End Sub
slide form
no code, just a form thats width 292 and height 266
This code works but its very choppy when the slider form slides up. Also, i am unable to get the opacity correct as well where it fades in and then out when it leaves.
Does anyone have any suggestions on how to correct this?
Thanks!