Programmering - BASIC - Visual Basic - Statements
downx.gif (830 bytes)AppActivate, Close, If.., Load, Open, SendKeys, TypeOf.., Unload

Statements - AppActivate

Activates (sets focus to) another application that is already loaded and running
Error 'Illegal Function Call' if the application is not running.
> Statement: On Error, SendKeys
> Function: Shell()

AppActivate Title [, Wait]
Title
 : 
The (exact) name that appears in the title-bar (not case sensitive).
If there is no exact match, any application whose title string begins with Title is activated.
> App.Title
Wait
 :
True : 
(default)The specified application is immediately activated, even if the calling application does not have the focus.
False: 
The calling application waits until it has the focus, then activates the specified application.
  
AppActivate "Notepad"

Statements - If..Then..Else..Endif

Statements - If..TypeOf..Is..Then..

Control Types
CheckBox, ComboBox, CommandButton, CommonDialog, DirListBox, DriveListBox, FileListBox, Frame, Grid, HScrollBar, Image, Label, ListBox, OleControl, OptionButton, Shape, TextBox, Timer, VScrollBar
> Function TypeName
If TypeOf Screen.ActiveControl Is CommandButton Then
  
For Each Control In Form1.Controls
  If Not TypeOf Control Is CommandButton Then
    Control.ForeColor = &HFF
  End If
Next

Statements - Load

Load places a Form in memory, but does not disply it

Load frmFrm1

Statements - Open, Close

For Input
For Output
FF = FreeFile
Open FileName For Output As #FF
For i = 0 To n - 1
  Print #FF, lstPrice.List(i)
Next
Close #FF
For Random

Statements - SendKeys

SendKeys sends a string of characters to the active form at runtime

Keys
[VB5]:
{BACKSPACE}|{BS}|{BKSP}, {BREAK}, {CAPSLOCK}, {DELETE}|{DEL}, {DOWN}, {END}, {ENTER}| ~, {ESC}, {HELP}, {HOME}, {INSERT}|{INS}, {LEFT}, {NUMLOCK}, {PGDN}, {PGUP}, {PRTSC}, {RIGHT}, {SCROLLLOCK}, {TAB}, {UP}
{F1}, {F2}, {F3}, {F4}, {F5}, {F6}, {F7}, {F8}, {F9}, {F10}, {F11}, {F12}, {F13}, {F14}, {F15}, {F16}
To specify keys combined with any combination of the SHIFT, CTRL, and ALT keys, precede the key code with one or more of the following codes:
SHIFT +, CTRL ^, ALT %
To specify that any combination of SHIFT, CTRL, and ALT should be held down while several other keys are pressed, enclose the code for those keys in parentheses. For example,
to specify to hold down SHIFT while E and C are pressed, use "+(EC)".
To specify to hold down SHIFT while E is pressed, followed by C without SHIFT, use "+EC".
To specify repeating keys, use the form {key number}. You must put a space between key and number. For example, {LEFT 42} means press the LEFT ARROW key 42 times;
{h 10} means press H 10 times.
Note: You can't use SendKeys to send keystrokes to an application that is not designed to run in Microsoft Windows. Sendkeys also can't send the PRINT SCREEN key {PRTSC} to any application.
SendKeys "{Home}+{End}" '<Home> <shift>_<End>

Statements - Typeof >If..

Statements - Unload

Removes a Form from memory