Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to get a list of all events of Winsock?

Status
Not open for further replies.

jslmvl

Vendor
Jan 26, 2008
268
GB
Hi,

When I double click the winsock control, only one event appeared:
private void axWinsock1_ConnectEvent(object sender, EventArgs e)
How to get a list of all events of Winsock?

Thanks a lot for your help in advance.
 
I assume you are talking about the visual IDE wizard stuff. double clicking an object will create a handler for the default event. you can get to other events through the properties tab/windows on VS, or you can wire the events yourself in code.
Code:
var foo = new Foo();
foo.AnEvent += DoSomething;
foo.AnEvent -= DoSomething;

Jason Meckley
Programmer
Specialty Bakers, Inc.

faq855-7190
faq732-7259
 
Sorry, I just cannot find any events for the winsock control except
private void axWinsock1_ConnectEvent(object sender, EventArgs e)
I tried right click, double click...
That control is not C# "bisic" control.....
 
axWinsock1_ConnectEvent is the handler not the event. somewhere in you code this line probably exists
Code:
axWinsock1.ConnectEvent += axWinsock1_ConnectEvent;
or
Code:
axWinsock1.ConnectEvent += new WinsockConnectEventHandler(axWinsock1_ConnectEvent);

this is how you wire a handler to an event. referencing the axWinsock1 object Intellisense should list the members of the object (properties, functions and events). find the events you want and attach the handlers as necessary.

Jason Meckley
Programmer
Specialty Bakers, Inc.

faq855-7190
faq732-7259
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top