如何检查是否在C#Winforms中单击了BUTTON到JAVA SCRIPT代码?随着webbrowser的使用 [英] How to check if BUTTON is clicked in C# Winforms to the JAVA SCRIPT code? With the use of webbrowser

查看:75
本文介绍了如何检查是否在C#Winforms中单击了BUTTON到JAVA SCRIPT代码?随着webbrowser的使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何检查是否在C#Winforms中单击了BUTTON到JAVA SCRIPT代码?使用webbrowser ...

How to check if BUTTON is clicked in C# Winforms to the JAVA SCRIPT code? With the use of webbrowser...

推荐答案

不,只是不可能。您无法从javascript访问正在运行的进程(winforms)应用程序,因此您无法在此类进程中处理按钮的单击事件。
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.


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;
    }


这篇关于如何检查是否在C#Winforms中单击了BUTTON到JAVA SCRIPT代码?随着webbrowser的使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆