Name

Private Statement

Synopsis



Private [WithEvents] varname[([subscripts])] [As [New] type] _
[, [WithEvents] varname[([subscripts])] [As [New] type]] ...
WithEvents optional; Keyword

A keyword that denotes the object variable, varname, can respond to events triggered from within the object to which it refers

varname required; any

The name of the variable, following Visual Basic naming conventions

subscripts optional; Integer or Long

Denotes varname as an array and specifies the number and extent of array dimensions

New optional; Keyword

Used to automatically create an instance of the object referred to by the varname object variable

type optional; Keyword

Data type of the variable varname

Description

Used at module level to declare a private variable and allocate the relevant storage space in memory. Private can also be used with procedures and class modules.

Get VB.NET Language Pocket Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.