Hi
Please tell vb.net equivalent of following:

C# Syntax

public class AuthorList : Control
	{
	static AuthorList()
		{
			Post.Saved += delegate { _Html = null; };
		}

I tried using C# to VB.NET code converter which gave me this:

Public Class AuthorList
        Inherits Control
           Shared Sub New()
               Post.Saved += Function() Do
               _Html = Nothing
           End Sub
   End Sub

Which on build in visual studio 2008 gives an error.

Please help

Recommended Answers

All 2 Replies

Use AddHandler.

AddHandler Post.Saved, Function() _Html = Nothing

Thanks adatapost this is the way i did finally

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.