After creating our first program we discuss two important topics. The overall principles of Visual Basic, i.e. Properties, Events and Methods. Also we discuss what the differences between Visual Basic 4 16-bit and VB4 32-bit and VB3.

PropertiesEvents
Describe or Format the object. Can be changed by code or poperty window.Events “happen” when the user does something…
  • Name of component
  • Color of component
  • Height of component
  • Caption/words attached to component
  • Font of component
  • If a control is named “Fred” for example, the line “Fred.Left=700” would position Fred on the screen.
  • A button has a _click event
  •  A spinner has an _SpinUp and _SpinDown event
  •  A form has a _load and _unload event
  •  When a user changes a text box a _change event happens
MethodsNote: Blurry Methapors/Semantics
Abilities are private/unique to a specific component and generally INITIATE AN ACTION as opposed to setting a characteristicOCX designers have often blurred properties and methods semantically. For example, you may set an .actionproperty to “dial” or “hangup” and then set off a .doaction method.
  • A phone OCX can .dial or .hangup. Example, a serial port control named “myphone” could be haung up with the code “myphone.hangup”. But it would the code “myphone.AddItem 5” would not be relevant (it is not a list).
  • A combo-box can be added to with .additem method or all items removed with a .clear method. But you wouldn’t .additem to a phone control for example, or .dial a combo box
  • A form can be moved with .move method, displayed with a .display method and hidden with a .hide method.

VB Reference: Standard Controls

The Help system details the properties and methods and events in detail. But here is a master list that gives you an overview of the Standard Controls and what they support.

NamePropertiesMethodsEvents
Check BoxAlignment, Appearance, BackColor, Caption, Container, DataChanged, DataField, DataSource, DragIcon, DragMode, Enabled, Font, FontBold, FontItalic, FontName, FontSize, FontStrikethru, FontUnderline, ForeColor, Height, HelpContextID, hWnd, Index, Left, MousePointer, Name, Parent, TabIndex, TabStop, Tag, Top, Value, Visible, WhatsThisHelpID, WidthDrag, Move, Refresh, SetFocus, ShowWhatsThis, ZOrderClick, DragDrop, DragOver, GotFocus, KeyDown, KeyPress, KeyUp, LostFocus, MouseDown, MouseMove, MouseUp
Combo BoxAppearance, BackColor, Container, DataChanged, DataField, DataSource, DragIcon, DragMode, Enabled, Font, FontBold, FontItalic, FontName, FontSize, FontStrikethru, FontUnderline, ForeColor, Height, HelpContextID, hWnd, Index, IntegralHeight, ItemData, Left, ListCount, ListIndex, List, MouseIcon, MousePointer, Name, NewIndex, Parent, SelLength, SelStart, SelText, Sorted, Style, TabIndex, TabStop, Tag, Text, Top, Visible, WhatsThisHelpID, WidthAddItem, Clear, Drag, Move, Refresh, RemoveItem, SetFocus, ShowWhatsThis, ZOrderChange, Click, DblClick, DragDrop, DragOver, DropDown, GotFocus, KeyDown, KeyPress, KeyUp, LostFocus
Command ButtonAppearance, BackColor, Cancel, Caption, Container, Default, DragIcon, DragMode, Enabled, Font, FontBold, FontItalic, FontName, FontSize, FontStrikethru, FontUnderline, Height, HelpContextID, hWnd, Index, Left, MouseIcon, MousePointer, Name, Parent, TabIndex, TabStop, Tag, Top, Value, Visible, WhatsThisHelpID, WidthDrag, Move, Refresh, SetFocus, ShowWhatsThis, ZOrderClick, DragDrop, DragOver, GotFocus, KeyDown, KeyPress, KeyUp, LostFocus, MouseDown, MouseMove, MouseUp
Common DialogColor
Action, CancelError, Color, Flags, HelpCommand, HelpContext, HelpFile, HelpKey, Object
File
Action, CancelError, DefaultExt, DialogTitle, FileName, FileTitle, Filter, FilterIndex, Flags, HelpCommand, HelpContext, HelpFile, HelpKey, InitDir, MaxFileSize, Object
Font
Action, CancelError, Flags, FontBold, FontItalic, FontName, FontSize, FontStrikethru, FontUnderline, HelpCommand, HelpContext, HelpFile, HelpKey, Max, Min, Object
Print
Action, CancelError, Copies, Flags, FromPage, hDC, HelpCommand, HelpContext, HelpFile, HelpKey, Max, MaxFileSize, Min, Object, PrinterDefault, ToPage
ShowColor, ShowFont, ShowHelp, ShowOpen, ShowPrinter, ShowSave
DataAlign, Appearance, BackColor, BOFAction, Caption, Connect, Database, DatabaseName, DragIcon, DragMode, EditMode, Enabled, EOFAction, Exclusive, Font, FontBold, FontItalic, FontName, FontSize, FontStrikethru, FontUnderline, ForeColor, Height, Index, Left, MouseIcon, MousePointer, Name, Options, ReadOnly, Recordset, RecordsetType, RecordSource, Tag, Top, Visible, WhatsThisHelpID, WidthDrag, Move, Refresh, ShowWhatsThis, UpdateControls, UpdateRecord, ZOrderDragDrop, DragOver, Error, MouseDown, MouseMove, MouseUp, Reposition, Resize, Validate
DB ComboAppearance, BackColor, BoundColumn, BoundText, Container, DataChanged, DataField, DataSource, DragIcon, DragMode, Enabled, Font, ForeColor, Height, HelpContextID, Index, IntegralHeight, Left, ListField, Locked, MatchedWithList, MatchEntry, MouseIcon, MousePointer, Name, Object, Parent, RowSource, SelectedItem, SelLength, SelStart, SelText, Style, TabIndex, TabStop, Tag, Text, Top, Visible, VisibleCount, VisibleItems, WhatsThisHelpID, WidthDrag, Move, Refill, Refresh, SetFocus, ShowWhatsThis, ZorderChange, Click, DblClick, DragDrop, DragOver, GotFocus, KeyDown, KeyPress, KeyUp, LostFocus, MouseDown, MouseMove, MouseUp
DBGridAlign, AllowAddNew, AllowDelete, AllowRowSizing, AllowUpdate, BackColor, Bookmark, BorderStyle, Caption, ColumnHeaders, Columns, Container, DataMode, DataSource, DefColWidth, DragIcon, DragMode, Enabled, Font, ForeColor, HeadFont, HeadLines, Height, HelpContextID, Index, Left, LeftCol, Name, Negotiate, Object, Parent, RecordSelectors, RowDividerStyle, RowHeight, ScrollBars, SelBookmarks, SelEndCol, SelStartCol, TabIndex, TabStop, Tag, Top, TopRow, Visible, VisibleCols, VisibleCount, VisibleItems, VisibleRows, WhatsThisHelpID, WidthColContaining, Drag, GetBookmark, Move, Rebind, Refresh, RowBookmark, RowContaining, RowTop, Scroll, SetFocus, ShowWhatsThis, ZorderAfterColUpdate, AfterDelete, AfterInsert, AfterUpdate, BeforeColUpdate, BeforeDelete, BeforeInsert, BeforeUpdate, Change, Click, ColResize, DblClick, DragDrop, DragOver, GotFocus, HeadClick, KeyDown, KeyPress, KeyUp, LostFocus, MouseDown, MouseMove, MouseUp, RowColChange, RowLoaded, RowResize, Scroll, SelChange, UnboundAddData, UnboundDeleteRow, UnboundReadData, UnboundWriteData
DBListAppearance, BackColor, BoundColumn, BoundText, DataChanged, DataField, DataSource, DragIcon, DragMode, Enabled, Font, ForeColor, Height, HelpContextID, Index, IntegralHeight, Left, ListField, Locked, MatchedWithList, MatchEntry, MouseIcon, MousePointer, Name, Parent, RowSource, SelectedItem, TabIndex, TabStop, Tag, Text, Top, Visible, VisibleCount, VisibleItems, WhatsThisHelpID, WidthDrag, Move, Refill, Refresh, SetFocus, ShowWhatsThis, ZorderClick, DblClick, DragDrop, DragOver, GotFocus, KeyDown, KeyPress, KeyUp, LostFocus, MouseDown, MouseMove, MouseUp
Dir List BoxAppearance, BackColor, Container, DragIcon, DragMode, Enabled, Font, FontBold, FontItalic, FontName, FontSize, FontStrikethru, FontUnderline, ForeColor, Height, HelpContextID, hWnd, Index, Left, List, ListCount, ListIndex, MouseIcon, MousePointer, Name, Parent, Path, TabIndex, TabStop, Tag, Top, Visible, WhatsThisHelpID, WidthDrag, Move, Refresh, SetFocus, ShowWhatsThis, ZorderChange, Click, DragDrop, DragOver, GotFocus, KeyDown, KeyPress, KeyUp, LostFocus, MouseDown, MouseMove, MouseUp
Drive List BoxAppearance, BackColor, Container, DragIcon, DragMode, Drive, Enabled, Font, FontBold, FontItalic, FontName, FontSize, FontStrikethru, FontUnderline, ForeColor, Height, HelpContextID, hWnd, Index, Left, List, ListCount, ListIndex, MouseIcon, MousePointer, Name, Parent, TabIndex, TabStop, Tag, Top, Visible, WhatsThisHelpID, WidthDrag, Move, Refresh, SetFocus, ShowWhatsThis, ZOrderChange, DragDrop, DragOver, GotFocus, KeyDown, KeyPress, KeyUp, LostFocus
File List BoxAppearance, Archive, BackColor, Container, DragIcon, DragMode, Enabled, FileName, Font, FontBold, FontItalic, FontName, FontSize, FontStrikethru, FontUnderline, ForeColor, Height, HelpContextID, Hidden, hWnd, Index, Left, List, ListCount, ListIndex, MouseIcon, MousePointer, MultiSelect, Name, Normal, Parent, Path, Pattern, ReadOnly, Selected, System, TabIndex, TabStop, Tag, Top, TopIndex, Visible, WhatsThisHelpID, WidthDrag, Move, Refresh, SetFocus, ShowWhatsThis, ZorderClick, DblClick, DragDrop, DragOver, GotFocus, KeyDown, KeyPress, KeyUp, LostFocus, MouseDown, MouseMove, MouseUp, PathChange, PatternChange
FrameAppearance, BackColor, Caption, ClipControls, Container, DragIcon, DragMode, Enabled, Font, FontBold, FontItalic, FontName, FontSize, FontStrikethru, FontUnderline, ForeColor, Height, HelpContextID, hWnd, Index, Left, MouseIcon, MousePointer, Name, Parent, TabIndex, Tag, Top, Visible, WhatsThisHelpID, WidthDrag, Move, Refresh, ShowWhatsThis, ZOrderClick, DblClick, DragDrop, DragOver, MouseDown, MouseMove, MouseUp
GridBackColor, BorderStyle, CellSelected, Clip, Col, ColAlignment, ColIsVisible, ColPos, Cols, ColWidth, Container, DragIcon, DragMode, Enabled, FillStyle, FixedAlignment, FixedCols, FixedRowsPropertyFont, FontBold, FontItalic, FontName, FontSize, FontStrikethru, FontUnderline, ForeColor, GridLines, GridLineWidth, Height, HelpContextID, HighLight, hWnd, Index, Left, LeftCol, MouseIcon, MousePointer, Name, Object, Parent, Picture, Row, RowHeight, RowIsVisible, RowPos, Rows, ScrollBars, SelEndCol, SelEndRow, SelStartCol, SelStartRow, TabIndex, TabStop, Tag, Text, Top, TopRow, Visible, WhatsThisHelpID, WidthAddItem, Drag, Move, Refresh, RemoveItem, SetFocus, ShowWhatsThis, ZOrderClick, DblClick, DragDrop, DragOver, GotFocus, KeyDown, KeyPress, KeyUp, LostFocus, MouseDown, MouseMove, MouseUp, RowColChange, SelChange
HscrollBarAppearance, Container, DragIcon, DragMode, Enabled, Height, HelpContextID, hWnd, Index, LargeChange, Left, Max, Min, MouseIcon, MousePointer, Name, Parent, SmallChange, TabIndex, TabStop, Tag, Top, Value, Visible, WhatsThisHelpID, WidthDrag, Move, Refresh, SetFocus, ShowWhatsThis, ZOrderChange, DragDrop, DragOver, GotFocus, KeyDown, KeyPress, KeyUp, LostFocus, Scroll
ImageAppearance, BorderStyle, Container, DataChanged, DataField, DataSource, DragIcon, DragMode, Enabled, Height, Index, Left, MouseIcon, MousePointer, Name, Parent, Picture, Stretch, Tag, Top, Visible, WhatsThisHelpID, WidthDrag, Move, Refresh, ShowWhatsThis, ZOrderClick, DblClick, DragDrop, DragOver, MouseDown, MouseMove, MouseUp
LabelAlignment, Appearance, AutoSize, BackColor, BackStyle, BorderStyle, Caption, Container, DataChanged, DataSource, DataField, DragIcon, DragMode, Enabled, Font, FontBold, FontItalic, FontName, FontSize, FontStrikethru, FontUnderline, ForeColor, Height, Index, Left, LinkItem, LinkMode, LinkTimeout, LinkTopic, MouseIcon, MousePointer, Name, Parent, TabIndex, Tag, Top, UseMnemonic, Visible, WhatsThisHelpID, Width, WordWrapDrag, LinkExecute, LinkPoke, LinkRequest, Move, Refresh, ShowWhatsThis, ZorderChange, Click, DblClick, DragDrop, DragOver, LinkClose, LinkError, LinkNotify, LinkOpen, MouseDown, MouseMove, MouseUp
LineAppearance, BorderColor, BorderStyle, BorderWidth, Container, DrawMode, Index, Name, Parent, Tag, Visible, X1, X2, Y1, Y2Refresh, Zorder
List BoxAppearance, BackColor, Columns, Container, DataChanged, DataField, DataSource, DragIcon, DragMode, Enabled, Font, FontBold, FontItalic, FontName, FontSize, FontStrikethru, FontUnderline, ForeColor, Height, HelpContextID, hWnd, Index, IntegralHeight, ItemData, Left, List, ListCount, ListIndex, MouseIcon, MousePointer, MultiSelect, Name, NewIndex, Parent, SelCount, Selected, Sorted, TabIndex, TabStop, Tag, Text, Top, TopIndex, Visible, WhatsThisHelpID, WidthAddItem, Clear, Drag, Move, Refresh, RemoveItem, SetFocus, ShowWhatsThis, ZorderClick, DblClick, DragDrop, DragOver, GotFocus, KeyDown, KeyPress, KeyUp, LostFocus, MouseDown, MouseMove, MouseUp
MenuAppearance, Caption, Checked, Enabled, HelpContextID, Index, Name, NegotiatePosition, Parent, ShortCut, Tag, Visible, WindowListClick
OLE ContainerAction, Appearance, AppIsRunning, AutoActivate, AutoVerbMenu, BackColor, BackStyle, BorderStyle, Class, Container, Data, DataChanged, DataField, DataSource, DataText, DisplayType, DragIcon, DragMode, Enabled, FileNumber, Format, Height, HelpContextID, HostName, hWnd, Index, Left, lpOleObject, MiscFlags, MouseIcon, MousePointer, Name, Object, ObjectAcceptFormats, ObjectAcceptFormatsCount, ObjectGetFormats, ObjectGetFormatsCount, ObjectVerbFlags, ObjectVerbs, ObjectVerbsCount, OLEDropAllowed, OLEType, OLETypeAllowed, Parent, PasteOK, Picture, SizeMode, SourceDoc, SourceItem, TabIndex, TabStop, Tag, Top, UpdateOptions, Verb, Visible, WhatsThisHelpID, WidthClose, Copy, CreateEmbed, CreateLink, Delete, DoVerb, Drag, FetchVerbs, InsertObjDlg, Move, Paste, PasteSpecialDlg, ReadFromFile, Refresh, SaveToFile, SaveToOle1File, SetFocus, ShowWhatsThis, Update, ZorderClick, DblClick, DragDrop, DragOver, GotFocus, KeyDown, KeyPress, KeyUp, LostFocus, MouseDown, MouseMove, MouseUp, ObjectMove, Resize, Updated
Option ButtonAlignment, Appearance, BackColor, Caption, Container, DragIcon, DragMode, Enabled, Font, FontBold, FontItalic, FontName, FontSize, FontStrikethru, FontUnderline, ForeColor, Height, HelpContextID, hWnd, Index, Left, MouseIcon, MousePointer, Name, Parent, TabIndex, TabStop, Tag, Top, Value, Visible, WhatsThisHelpID, WidthDrag, Move, Refresh, SetFocus, ShowWhatsThis, ZorderClick, DblClick, DragDrop, DragOver, GotFocus, KeyDown, KeyPress, KeyUp, LostFocus, MouseDown, MouseMove, MouseUp
Picture BoxAlign, Appearance, AutoRedraw, AutoSize, BackColor, BorderStyle, ClipControls, Container, CurrentX, CurrentY, DataChanged, DataField, DataSource, DragIcon, DragMode, DrawMode, DrawStyle, DrawWidth, Enabled, FillColor, FillStyle, Font, FontBold, FontItalic, FontName, FontSize, FontStrikethru, FontTransparent, FontUnderline, ForeColor, hDC, Height, HelpContextID, hWnd, Image, Index, Left, LinkItem, LinkMode, LinkTimeout, LinkTopic, MouseIcon, MousePointer, Name, Parent, Picture, ScaleHeight, ScaleLeft, ScaleMode, ScaleTop, ScaleWidth, TabIndex, TabStop, Tag, Top, Visible, WhatsThisHelpID, WidthCircle, Cls, Drag, Line, LinkExecute, LinkPoke, LinkRequest, LinkSend, Move, PaintPicture, Point, Print, PSet, Refresh, Scale, ScaleX, ScaleY, SetFocus, ShowWhatsThis, TextHeight, TextWidth, ZOrderChange, Click, DblClick, DragDrop, DragOver, GotFocus, KeyDown, KeyPress, KeyUp, LinkClose, LinkError, LinkNotify, LinkOpen, LostFocus, MouseDown, MouseMove, MouseUp, Paint, Resize
ShapeAppearance, BackColor, BackStyle, BorderColor, BorderStyle, BorderWidth, Container, DrawMode, FillColor, FillStyle, Height, Index, Left, Name, Parent, Shape, Tag, Top, Visible, WidthMove, Refresh, Zorder
Text BoxAlignment, Appearance, BackColor, BorderStyle, Container, DataChanged, DataField, DataSource, DragIcon, DragMode, Enabled, Font, FontBold, FontItalic, FontName, FontSize, FontStrikethru, FontUnderline, ForeColor, Height, HelpContextID, HideSelection, hWnd, Index, Left, LinkItem, LinkMode, LinkTimeout, LinkTopic, Locked, MaxLength, MouseIcon, MousePointer, MultiLine, Name, Parent, PasswordChar, ScrollBars, SelLength, SelStart, SelText, TabIndex, TabStop, Tag, Text, Top, Visible, WhatsThisHelpID, WidthDrag, LinkExecute, LinkPoke, LinkRequest, Move, Refresh, SetFocus, ShowWhatsThis, ZOrderChange, Click, DblClick, DragDrop, DragOver, GotFocus, KeyDown, KeyPress, KeyUp, LinkClose, LinkError, LinkNotify, LinkOpen, LostFocus, MouseDown, MouseMove, MouseUp
TimerEnabled, Index, Interval, Left, Name, Parent, Tag, TopTimer
Vscroll BarAppearance, Container, DragIcon, DragMode, Enabled, Height, HelpContextID, hWnd, Index, LargeChange, Left, Max, Min, MouseIcon, MousePointer, Name, Parent, SmallChange, TabIndex, TabStop, Tag, Top, Value, Visible, WhatsThisHelpID, WidthDrag, Move, Refresh, SetFocus, ShowWhatsThis, ZOrderChange, DragDrop, DragOver, GotFocus, KeyDown, KeyPress, KeyUp, LostFocus, Scroll

Go to home for more information and to start navigating to the best resources.