Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sliding Form with timer

Status
Not open for further replies.

HydraNL

Technical User
May 9, 2005
74
NL
Hi,

I am trying to slide, make the form bigger, with a button. but each time it freezes. can someone help me out?

This is one of the codes I tried.

Code:
Option Explicit
   
   Private Sub Form_Load()
      Timer1.Enabled = False
   End Sub

   Private Sub Command1_Click()
      Timer1.Enabled = True
      Timer1.Interval = 50
   End Sub

   Private Sub Timer1_Timer()
   Dim i As Long

   i = 100

      Do Until Me.Height = 6000
         Me.Height = i + i
      Loop
   End Sub

Greetings J. Radjesh Klauke (Netherlands)
 
Starting from i=100 and using Me.Height = i + i will never get to Me.Height = 6000 (i + i = 200)

Try:
Code:
   Private Sub Timer1_Timer()
         Me.Height = Me.Height + 100
      If Me.Height > 6000 Then
         Timer1.Enabled = False
      End If
   End Sub

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
 
ah. stupid. stupid. stupid.
Me.Height = Me.Height + ..... etc.

Thanks for the info.
Little questionn left. It there a way to slow down the sliding less then 1? I mean:

Private Sub Timer1_Timer()
Timer1.Interval = 1 '<-- Is there a way to make the scrolling more slow?
Me.height = me.height +1

if Me.height > then 6000 then
timer1.enabeld = false
end if
end sub
 
Increase the timer interval to slow down the movement

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
 
Timers don't fire at intervals quicker than 10 milliseconds, no matter what you set them to. Try 500 for half a second.

David
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top