!!!!***Cool Roll***!!!!

By | 2002-06-01

This is a really cool effect that you can add to make it so that when you click a minimize button, the form slides off the screen and a little mini form appears in the bottom left hand corner. When you click this mini forms title bar, the form appears again. A Very cool effect that I just figured out. (o:

Original Author: SeeD

Inputs

Follow these instructions.
1) Start up a new project in your VB.
2) Add a new form. (Form2)
3) Add a timer to Form 1 and set it’s interval to 1 by pressing F4 to access the properties.
4) Make Form 1’s Border Style “0 – None” and make Form 2’s Border Style “3 – Fixed Dialog”.
5) Add a Label to Form 1. (Label1) Make it’s caption “_” (For Minimize)
6) Make Form2’s Property “ControlBox = False”.
7) Make Form2’s Property “Movable = False”.
8) And MOST IMPORTANTLY, make Form2’s Property “WindowState = “Minimized”
9) That’s all, but remember to MINIMIZE YOUR VB WHEN RUNNING THIS CODE. Thanks. (o:

Code

'Put this in Form1's General Declarations.
Private Sub Label1_Click()
  Timer1.Enabled = True
    
  Form2.Visible = True
End Sub

Private Sub Form_Load()
  Timer1.Enabled = False
End Sub

Private Sub Timer1_Timer()
  Form1.Top = Form1.Top + 60 'You can adjust the 60 to whatever you prefer. Highering it will make the form drop faster. (o:
  Form2.Enabled = True
End Sub
'Put this in Form2's General Declarations. (o:
Private Sub Form_Activate()
  Form1.Show
  Form2.Hide
  Form1.Top = (Screen.Height - Height) / 2
  Form1.Left = (Screen.Width - Width) / 2
  Form1.Timer1.Enabled = False
End Sub

Author: dwirch

Derek Wirch is a seasoned IT professional with an impressive career dating back to 1986. He brings a wealth of knowledge and hands-on experience that is invaluable to those embarking on their journey in the tech industry.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.