-1

I'm trying to finish off the twitch iRC Bot i did a year ago, but never did because of this i asking for help on this, and yes i know i can't have more than 2 parameters but atleast help thanks, i need the "msg" parameter to send a message.

         public void SendMsgBtn(object sender,EventArgs e, OnJoinedChannelArgs msg)
        {
            if (client.IsConnected)
            {
                
                client.SendMessage(msg.Channel,textBox1.Text);
            }
            textBox1.Clear();
        }

this.button6.Click += new System.EventHandler(this.SendMsgBtn);

1
  • You can't arbitrarily add parameters to an event like Click. Store what you need in a private variable, so you can use them (later) in a button's Click event handler. While you're at it, be sure to set the button's Enabled property so the user can't click it when no channel has been joined yet. May 3, 2021 at 11:27

1 Answer 1

0

use this code:

this.button6.Click+=SendMsgBtn;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.