Make your own free website on Tripod.com

Visual Basic Overview: Properties, Events, Methods

Properties Events
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 "Vamsi" for example, the line "Vamsi.Left=700" would position Vamsi 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
Methods Note: Blurry Methapors/Semantics
Abilities are private/unique to a specific component and generally INITIATE AN ACTION as opposed to setting a characteristic OCX designers have often blurred properties and methods semantically. For example, you may set an .action property 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.

Name Properties Methods Events
Check Box Alignment, 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, Width Drag, Move, Refresh, SetFocus, ShowWhatsThis, ZOrder Click, DragDrop, DragOver, GotFocus, KeyDown, KeyPress, KeyUp, LostFocus, MouseDown, MouseMove, MouseUp
Combo Box Appearance, 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, Width AddItem, Clear, Drag, Move, Refresh, RemoveItem, SetFocus, ShowWhatsThis, ZOrder Change, Click, DblClick, DragDrop, DragOver, DropDown, GotFocus, KeyDown, KeyPress, KeyUp, LostFocus
Command Button Appearance, 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, Width Drag, Move, Refresh, SetFocus, ShowWhatsThis, ZOrder Click, DragDrop, DragOver, GotFocus, KeyDown, KeyPress, KeyUp, LostFocus, MouseDown, MouseMove, MouseUp
Common Dialog Color
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  
Data Align, 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, Width Drag, Move, Refresh, ShowWhatsThis, UpdateControls, UpdateRecord, ZOrder DragDrop, DragOver, Error, MouseDown, MouseMove, MouseUp, Reposition, Resize, Validate
DB Combo Appearance, 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, Width Drag, Move, Refill, Refresh, SetFocus, ShowWhatsThis, Zorder Change, Click, DblClick, DragDrop, DragOver, GotFocus, KeyDown, KeyPress, KeyUp, LostFocus, MouseDown, MouseMove, MouseUp
DBGrid Align, 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, Width ColContaining, Drag, GetBookmark, Move, Rebind, Refresh, RowBookmark, RowContaining, RowTop, Scroll, SetFocus, ShowWhatsThis, Zorder AfterColUpdate, 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
DBList Appearance, 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, Width Drag, Move, Refill, Refresh, SetFocus, ShowWhatsThis, Zorder Click, DblClick, DragDrop, DragOver, GotFocus, KeyDown, KeyPress, KeyUp, LostFocus, MouseDown, MouseMove, MouseUp
Dir List Box Appearance, 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, Width Drag, Move, Refresh, SetFocus, ShowWhatsThis, Zorder Change, Click, DragDrop, DragOver, GotFocus, KeyDown, KeyPress, KeyUp, LostFocus, MouseDown, MouseMove, MouseUp
Drive List Box Appearance, 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, Width Drag, Move, Refresh, SetFocus, ShowWhatsThis, ZOrder Change, DragDrop, DragOver, GotFocus, KeyDown, KeyPress, KeyUp, LostFocus
File List Box Appearance, 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, Width Drag, Move, Refresh, SetFocus, ShowWhatsThis, Zorder Click, DblClick, DragDrop, DragOver, GotFocus, KeyDown, KeyPress, KeyUp, LostFocus, MouseDown, MouseMove, MouseUp, PathChange, PatternChange
Frame Appearance, 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, Width Drag, Move, Refresh, ShowWhatsThis, ZOrder Click, DblClick, DragDrop, DragOver, MouseDown, MouseMove, MouseUp
Grid BackColor, BorderStyle, CellSelected, Clip, Col, ColAlignment, ColIsVisible, ColPos, Cols, ColWidth, Container, DragIcon, DragMode, Enabled, FillStyle, FixedAlignment, FixedCols, FixedRowsProperty

Font, 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, Width

AddItem, Drag, Move, Refresh, RemoveItem, SetFocus, ShowWhatsThis, ZOrder Click, DblClick, DragDrop, DragOver, GotFocus, KeyDown, KeyPress, KeyUp, LostFocus, MouseDown, MouseMove, MouseUp, RowColChange, SelChange
Hscroll

Bar

Appearance, Container, DragIcon, DragMode, Enabled, Height, HelpContextID, hWnd, Index, LargeChange, Left, Max, Min, MouseIcon, MousePointer, Name, Parent, SmallChange, TabIndex, TabStop, Tag, Top, Value, Visible, WhatsThisHelpID, Width Drag, Move, Refresh, SetFocus, ShowWhatsThis, ZOrder Change, DragDrop, DragOver, GotFocus, KeyDown, KeyPress, KeyUp, LostFocus, Scroll
Image Appearance, BorderStyle, Container, DataChanged, DataField, DataSource, DragIcon, DragMode, Enabled, Height, Index, Left, MouseIcon, MousePointer, Name, Parent, Picture, Stretch, Tag, Top, Visible, WhatsThisHelpID, Width Drag, Move, Refresh, ShowWhatsThis, ZOrder Click, DblClick, DragDrop, DragOver, MouseDown, MouseMove, MouseUp
Label Alignment, 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, WordWrap Drag, LinkExecute, LinkPoke, LinkRequest, Move, Refresh, ShowWhatsThis, Zorder Change, Click, DblClick, DragDrop, DragOver, LinkClose, LinkError, LinkNotify, LinkOpen, MouseDown, MouseMove, MouseUp
Line Appearance, BorderColor, BorderStyle, BorderWidth, Container, DrawMode, Index, Name, Parent, Tag, Visible, X1, X2, Y1, Y2 Refresh, Zorder  
List Box Appearance, 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, Width AddItem, Clear, Drag, Move, Refresh, RemoveItem, SetFocus, ShowWhatsThis, Zorder Click, DblClick, DragDrop, DragOver, GotFocus, KeyDown, KeyPress, KeyUp, LostFocus, MouseDown, MouseMove, MouseUp
Menu Appearance, Caption, Checked, Enabled, HelpContextID, Index, Name, NegotiatePosition, Parent, ShortCut, Tag, Visible, WindowList   Click
OLE Container Action, 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, Width Close, Copy, CreateEmbed, CreateLink, Delete, DoVerb, Drag, FetchVerbs, InsertObjDlg, Move, Paste, PasteSpecialDlg, ReadFromFile, Refresh, SaveToFile, SaveToOle1File, SetFocus, ShowWhatsThis, Update, Zorder Click, DblClick, DragDrop, DragOver, GotFocus, KeyDown, KeyPress, KeyUp, LostFocus, MouseDown, MouseMove, MouseUp, ObjectMove, Resize, Updated
Option Button Alignment, 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, Width Drag, Move, Refresh, SetFocus, ShowWhatsThis, Zorder Click, DblClick, DragDrop, DragOver, GotFocus, KeyDown, KeyPress, KeyUp, LostFocus, MouseDown, MouseMove, MouseUp
Picture Box Align, 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, Width Circle, Cls, Drag, Line, LinkExecute, LinkPoke, LinkRequest, LinkSend, Move, PaintPicture, Point, Print, PSet, Refresh, Scale, ScaleX, ScaleY, SetFocus, ShowWhatsThis, TextHeight, TextWidth, ZOrder Change, Click, DblClick, DragDrop, DragOver, GotFocus, KeyDown, KeyPress, KeyUp, LinkClose, LinkError, LinkNotify, LinkOpen, LostFocus, MouseDown, MouseMove, MouseUp, Paint, Resize
Shape Appearance, BackColor, BackStyle, BorderColor, BorderStyle, BorderWidth, Container, DrawMode, FillColor, FillStyle, Height, Index, Left, Name, Parent, Shape, Tag, Top, Visible, Width Move, Refresh, Zorder  
Text Box Alignment, 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, Width Drag, LinkExecute, LinkPoke, LinkRequest, Move, Refresh, SetFocus, ShowWhatsThis, ZOrder Change, Click, DblClick, DragDrop, DragOver, GotFocus, KeyDown, KeyPress, KeyUp, LinkClose, LinkError, LinkNotify, LinkOpen, LostFocus, MouseDown, MouseMove, MouseUp
Timer Enabled, Index, Interval, Left, Name, Parent, Tag, Top   Timer
Vscroll Bar Appearance, Container, DragIcon, DragMode, Enabled, Height, HelpContextID, hWnd, Index, LargeChange, Left, Max, Min, MouseIcon, MousePointer, Name, Parent, SmallChange, TabIndex, TabStop, Tag, Top, Value, Visible, WhatsThisHelpID, Width Drag, Move, Refresh, SetFocus, ShowWhatsThis, ZOrder Change, DragDrop, DragOver, GotFocus, KeyDown, KeyPress, KeyUp, LostFocus, Scroll

This page was created by Vamsi Krishna

perivamsi@hotmail.com