Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Dear The Expert,

I need to create custom event that will automatically executed when the event occurs? is it possible to do this in VB.NET? ..if Yes ..could any body please help me how to do this?

 

many thanks in advance

 

Regards

Winan

Posted

Regarding to my previous posts.. for example to create custom read event for tcplistener and refreshing the datagrid? .. I need the read event for tcplistener, this will automatically executed when a strings received .. and for datagrid control .. for determine when the new record added or a record modified to a table .. .. is it possible? .. many thanks

 

Winan

Posted

Do you mean:

Public Event DataArrived()

To make an event?

 

In order to get a TcpClient to check for data you'll need to use:

If MyTcpClient.GetStream.DataAvailable = True Then RaiseEvent DataArrived

Put the above code in a Polling function and call it in a loop or a Timer

.Net allows software to be written for any version of Windows and not break like Unmanaged applications unless using Unmanaged procedures like APIs. If your program uses large amounts of memory but releases it when something else needs it, then what's the problem?
Posted

Just to add some info to the AndreRyan reply you can pass arguments in the custom events too... like:

 

Public Event DataArrived(ByVal sender As Object, ByVal e As EventArgs)

 

If you want to pass something special with the event (some valiables states or anything else you can enherit from the class EventArgs and make your own Arguments... quite easy task...

 

Enjoy !

Software bugs are impossible to detect by anybody except the end user.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...