About 8,480,000 results
Open links in new tab
  1. How to: Declare an Object by Using an Object Initializer - Visual Basic ...

    Sep 15, 2021 · Object initializers enable you to declare and instantiate an instance of a class in a single statement. In addition, you can initialize one or more members of the instance at the same time, without invoking a parameterized constructor.

  2. How to: Initialize an Array Variable in Visual Basic

    Sep 15, 2021 · You initialize an array variable by including an array literal in a New clause and specifying the initial values of the array. You can either specify the type or allow it to be inferred from the values in the array literal.

  3. Defining Classes - Visual Basic | Microsoft Learn

    Sep 15, 2021 · This walkthrough demonstrates how to define classes, which you can then use to create objects. It also shows you how to add properties and methods to the new class, and demonstrates how to initialize an object.

  4. VBA: Initialize object with values? - Stack Overflow

    It might be useful to create a InitializeFromRange(ByVal r as Range) method in order to pull values from a worksheet table. If anyone gets here by a search, as did I. I recommend looking instead at the answers in StackOverFlow: Pass arguments to Constructor in VBA. This is not my answer, it came from Bgusach.

  5. Initialize Objects Properly -- Visual Studio Magazine

    Dec 1, 2007 · Learn how to initialize objects properly and avoid small missteps that can lead to big problems when creating and initializing objects. You'd like to think that an object either exists or doesn't exist. But it's not that simple. There are many …

  6. docs/docs/visual-basic/programming-guide/language-features ... - GitHub

    Jul 20, 2015 · How to: Declare an Object by Using an Object Initializer (Visual Basic) Object initializers enable you to declare and instantiate an instance of a class in a single statement. In addition, you can initialize one or more members of the instance at the same time, without invoking a parameterized constructor.

  7. .net - Inline list initialization in VB.NET - Stack Overflow

    Apr 13, 2010 · How is the following C# code translated to VB.NET? Collection initializers are only available in VB.NET 2010, released 2010-04-12: @freefaller: With Option Infer, you don't need to. Use this syntax for VB.NET 2005/2008 compatibility: Although the VB.NET 2010 syntax is prettier. This is not the same.

  8. VB.NET Class Initialization and Functions - Stack Overflow

    Mar 23, 2012 · Is there a way to call functions within a class upon instantiation of that same class? Basically, I have functions within a class, but I want to automatically call some of those functions simply when there is an instance of the class created. Basically, I have this structure: Dim instance as new class. instance.function1. instance.function2.

  9. Collection Initializers - Visual Basic | Microsoft Learn

    Sep 15, 2021 · Collection initializers provide a shortened syntax that enables you to create a collection and populate it with an initial set of values.

  10. VBA Variables - Initialising - BetterSolutions.com

    5 days ago · In VBA it is not possible to declare and initialise a variable in one line. You must declare your variable on one line and then assign the value on a new line. Explicitly assigning a value to a local variable after it has been declared is recommended. Using a Colon Separator to put these on one line makes your code harder to read.

Refresh