C# button_click object sender



What is object sender, EventArgs e?

https://www.codeproject.com/Questions/1068892/What-is-object-sender-EventArgs-e


How to call a button click event from another method

https://stackoverflow.com/a/14479279/10763264



Sample coding

        void btnSBC_Click(object sender, EventArgs e)
        {
            String stncode = sender.ToString();
            stncode = stncode.Substring(stncode.IndexOf(":") + 1);
            stncode = stncode.Replace(" ", "");

            System.Windows.Forms.Button btn = (System.Windows.Forms.Button)sender;

            if(btn.BackColor.ToString() == "GreenYellow")
            {
                Form9 f9 = new Form9(connects, "Enabled", stncode);
                f9.ShowDialog();
            }
            else {
                Form9 f9 = new Form9(connects, "Disabled", stncode);
                f9.ShowDialog();
            }
        }

Ulasan

Catatan popular daripada blog ini

SISTEM PENGOPERASIAN KOMPUTER (OS)

APA ITU ASCII (AMERICAN STANDARD CODE FOR INFORMATION INTERCHANGE) ?

APA ITU EBCDIC (EXTANDENT BINARY CODEC DECIMAL INTERCHANGE CODE) ?

JENIS-JENIS SISTEM PENGOPERASIAN KOMPUTER

Router CP2001/RS980+ dan Cara config