Click here to Skip to main content
15,888,330 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
How to check if BUTTON is clicked in C# Winforms to the JAVA SCRIPT code? With the use of webbrowser...
Posted

Not, just isn't possible. You cannot access running processes (winforms) application from javascript, so you cannot handle a click event of a button inside such a process.
 
Share this answer
 
C#
this.buttonNW.Click += new System.EventHandler(this.button_Click);
this.buttonN.Click += new System.EventHandler(this.button_Click);
this.buttonNE.Click += new System.EventHandler(this.button_Click);


// in the form code:
private void button_Click(object sender, EventArgs e) {
    Button thisButton = (Button)sender;

    switch (thisButton.Name) {
        case "buttonNW":
            MessageBox.Show("North West button clicked");
            break;
        case "buttonN":
            MessageBox.Show("Northern button clicked");
            break;
        case "buttonNE":
            MessageBox.Show("North East button clicked");
            break;
    }
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900