Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

This is probably a really stupid question, but how can I handle events for an object I create in the code? For example: I have a Client, and Server, and using sockets, I can get them to connect, but how can I handle the Connected event?

btw I'm a real newbie at this....I got C++.NET yesterday lol

Posted

Connected isn't an event....is it. So the only way to check if a socket is connected is by putting a timer on the form, and checking to see if Connected == true?

At least by this mistake I found out how to handle events. (Thanks Windows Form Designer!)

  • 3 weeks later...
Posted

Sorry I didn't explain myself

 

Sorry, I just meant how to handle events, for example a button's click event, I realized after looking that Connected for a socket is not an event. I found that handling events is done like this:

this->button1->Click += gcnew System::EventHandler(this, &Form1::button1_Click);

Sorry about confusing you.

Is that the proper way to do it?

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...