Ralphzehunter Posted November 10, 2004 Posted November 10, 2004 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 Quote
Ralphzehunter Posted November 10, 2004 Author Posted November 10, 2004 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!) Quote
HJB417 Posted November 10, 2004 Posted November 10, 2004 Socket.BeginConnect is probably what you want. Quote
Ralphzehunter Posted December 2, 2004 Author Posted December 2, 2004 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? Quote
HJB417 Posted December 2, 2004 Posted December 2, 2004 looks like you're using the beta version of the framework. but it looks right. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.