by Alexander Drankus ((DeVry Chicago)) (2 Submissions)
Category: Custom Controls/Forms/Menus
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Thu 23rd November 2000
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Scroll's Form Either Way You Want !
API Declarations
'You need Two Option Buttons, "Option1", "Option2"
'You need one Command Button, "Command1"
'You need one Timer, "Timer1"
'Set's the Interval for the timer
Timer1.Interval = 1
End Sub
Private Sub Form_Load()
'Place Caption Values
Me.Caption = "Created by: Alexander Drankus, DeVry Chicago"
Option1.Caption = "Start on Left"
Option2.Caption = "Start on Right"
Command1.Caption = "Animate Form"
'Place Width Values
Option1.Width = 1455
Option2.Width = 1455
Command1.Width = 1215
'Place Height Values
Option1.Height = 255
Option2.Height = 255
Command1.Height = 375
End Sub
Private Sub Option1_Click()
'Put's the form on the Left side of screen
Me.Left = 0
End Sub
Private Sub Option2_Click()
'Put's the form on the Right side of screen
Me.Left = Screen.Width - Me.Width
End Sub
Private Sub Timer1_Timer()
'Find which Option value was choosen
If Option1.Value = True Then
'Scroll Form to the Right
Me.Left = Me.Left + 100
Else
'Scroll Form to the Left
Me.Left = Me.Left - 100
End If
End Sub