|
What to do: |
Code to do it: |
how to make a password checker: |
you need 1 text box and 1 command button, in the command button type this code:
|
how to make a message box appear when you load a program: |
double click the form and type in the following code
in Form_Load: |
how to make a message box keep on appearing after
you press ok: |
double click the form and type in the following code
in Form_Load: |
how to make a form unload after 5 seconds: |
you need 1 timer |
how to center a form on the screen: |
double click the form and type the following code in Form_Load: Form1.Move(Screen.width-form1.width)\2,(screen.height-form1.height)\2 |
how to center a form at the top of the screen: |
double click the form and type in the following
code in Form_Load:
Form1.Left = (Screen.Width - Form1.Width) / 2 |
how to make a form always stay on top: |
Dim lRetVal As Long
lRetVal = SetWindowPos(form1.hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOACTIVATE Or SWP_NOSIZE Or SWP_NOMOVE) Paste the following code into a module:
Declare Function SetWindowPos Lib "user32" (ByVal hwnd
As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long,
ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Public Const HWND_TOPMOST = -1
|
how to scroll caption on titlebar: |
Sub TitleScroll(frm As Form)
Dim X As Integer
current = Timer |