Jump to content
xisto Community
Sign in to follow this  
PureHeart

Help On Inherit A Class In VB.NET ! Especially System.Net.Sockets.Socket

Recommended Posts

I've just move to VB.NET. I need to know how to inherit a class in VB.NET

In networking application, whenever I want to make a connection, I add the WinSock control to the form and use the codes like

 

Privated Sub wSock_Data_Arrival(ByVal bytesTotal as Long)'Codes go hereEnd Sub

But in VB.NET, I have to use System.Net.Sockets.socket class.

How can I inherit a class in VB.NET, handle the events to the object.

 

Please post the code also.

Share this post


Link to post
Share on other sites

Keep the questions coming. This Thread has been dead way too long and now I get to gab about something I want to. I have written a tutorial especially for you at http://forums.xisto.com/topic/88313-topic/?findpost=1064335400.

The short answer to your question is to use the Imports statement. I.e Imports System.IO right before the class name

Option Strict On
Option Explicit On

Imports System.Net

Public Class FrmMain
Inherits System.Windows.Forms.Form
.......

Share this post


Link to post
Share on other sites

Can you give me an example of what you are trying to do. When you are going from VB6 to .NET the rules have changes alittle bit. According what the event you are thrying to handle is, different ways will be used. Errors will be handled by a Try/Catch. Events that are created with add event will need a handler function. More information would much more helpful.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.