Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,6 @@ System.Diagnostics.Debug.WriteLine("Hello World!");

You can produce custom results by implementing your own listener. A custom trace listener might, for example, display the messages to a message box, or connect to a database to add messages to a table. All custom listeners should support the six methods mentioned above. For more information on creating developer-defined listeners, see <xref:System.Diagnostics.TraceListener> in the .NET Framework reference.

> [!NOTE]
> In Visual Basic, the **Debug.Write**, **Debug.WriteIf**, **Debug.WriteLine**, and **Debug.WriteLineIf** methods have replaced the **Debug.Print** method that was available in earlier versions of Visual Basic.

The **Write** and **WriteLine** methods always write the text that you specify. **Assert**, **WriteIf**, and **WriteLineIf** require a Boolean argument that controls whether or not they write the specified text; they write the specified text only if the expression is **true** (for **WriteIf** and **WriteLineIf**), or **false** (for **Assert**). The **Fail** method always writes the specified text. For more information, see [How to: Add Trace Statements to Application Code](../../../docs/framework/debug-trace-profile/how-to-add-trace-statements-to-application-code.md) and the .NET Framework reference.

## Security Concerns
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ The following is an alphabetic list of controls and components that can be used
Provides links to step-by-step topics, recommendations for which kind of control to create, and other information about creating your own control.

[Controls and Programmable Objects Compared in Various Languages and Libraries](https://docs.microsoft.com/previous-versions/visualstudio/visual-studio-2010/0061wezk(v=vs.100))
Provides a table that maps controls in Visual Basic 6.0 to the corresponding control in Visual Basic. Note that controls are now classes in the .NET Framework.
Provides a table that maps controls in Visual Basic 6.0 to the corresponding control in Visual Basic .NET. Note that controls are now classes in the .NET Framework.

[How to: Add ActiveX Controls to Windows Forms](how-to-add-activex-controls-to-windows-forms.md)
Describes how to use ActiveX controls on Windows Forms.
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ To use event properties, you define the event properties in the class that raise
## Example
The following C# example implements the event properties `MouseDown` and `MouseUp`, using an <xref:System.ComponentModel.EventHandlerList> to store each event's delegate. The keywords of the event property constructs are in bold type.

> [!NOTE]
> Event properties are not supported in Visual Basic.

[!code-cpp[Conceptual.Events.Other#31](../../../samples/snippets/cpp/VS_Snippets_CLR/conceptual.events.other/cpp/example3.cpp#31)]
[!code-csharp[Conceptual.Events.Other#31](../../../samples/snippets/csharp/VS_Snippets_CLR/conceptual.events.other/cs/example3.cs#31)]
[!code-vb[Conceptual.Events.Other#31](../../../samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.events.other/vb/example3.vb#31)]
Expand All @@ -48,5 +45,5 @@ To use event properties, you define the event properties in the class that raise

- <xref:System.ComponentModel.EventHandlerList?displayProperty=nameWithType>
- [Events](../../../docs/standard/events/index.md)
- <xref:System.Web.UI.Control.Events%2A>
- <xref:System.Web.UI.Control.Events%2A?displayProperty=nameWithType>
- [How to: Declare Custom Events To Conserve Memory](~/docs/visual-basic/programming-guide/language-features/events/how-to-declare-custom-events-to-conserve-memory.md)
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Constructors and destructors control the creation and destruction of objects. Th

### Sub New

The `Sub New` constructor can run only once when a class is created. It cannot be called explicitly anywhere other than in the first line of code of another constructor from either the same class or from a derived class. Furthermore, the code in the `Sub New` method always runs before any other code in a class. Visual Basic and later versions implicitly create a `Sub New` constructor at run time if you do not explicitly define a `Sub New` procedure for a class.
The `Sub New` constructor can run only once when a class is created. It cannot be called explicitly anywhere other than in the first line of code of another constructor from either the same class or from a derived class. Furthermore, the code in the `Sub New` method always runs before any other code in a class. Visual Basic implicitly creates a `Sub New` constructor at run time if you do not explicitly define a `Sub New` procedure for a class.

To create a constructor for a class, create a procedure named `Sub New` anywhere in the class definition. To create a parameterized constructor, specify the names and data types of arguments to `Sub New` just as you would specify arguments for any other procedure, as in the following code:

Expand All @@ -58,7 +58,7 @@ Before releasing objects, the CLR automatically calls the `Finalize` method for

The `Finalize` destructor is a protected method that can be called only from the class it belongs to, or from derived classes. The system calls `Finalize` automatically when an object is destroyed, so you should not explicitly call `Finalize` from outside of a derived class's `Finalize` implementation.

Unlike `Class_Terminate`, which executes as soon as an object is set to nothing, there is usually a delay between when an object loses scope and when Visual Basic calls the `Finalize` destructor. Visual Basic and later versions allow for a second kind of destructor, <xref:System.IDisposable.Dispose%2A>, which can be explicitly called at any time to immediately release resources.
Unlike `Class_Terminate`, which executes as soon as an object is set to nothing, there is usually a delay between when an object loses scope and when Visual Basic calls the `Finalize` destructor. Visual Basic .NET allows for a second kind of destructor, <xref:System.IDisposable.Dispose%2A?displayProperty=nameWithType>, which can be explicitly called at any time to immediately release resources.

> [!NOTE]
> A `Finalize` destructor should not throw exceptions, because they cannot be handled by the application and can cause the application to terminate.
Expand Down