如何在网页浏览器窗口中加载的网页上加载文本字段时获取消息框? [英] How to get a message box when a text field on a webpage loaded within web browser control of windows form?

查看:126
本文介绍了如何在网页浏览器窗口中加载的网页上加载文本字段时获取消息框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问题清除了所有。

我想知道当窗口窗体的Web浏览器控件中加载的网页上的文本字段获得焦点时,如何执行任何事件或调用函数。在此先感谢

Question clears it all.
I want to know How can I execute any event or call a function when a text field on a web page loaded within a web browser control of windows form get focus.Thanks in advance

推荐答案

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="WebForm6.aspx.vb" Inherits="WebApplication1.WebForm6" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >

<script type="text/javascript" language="javascript">
function EnterEvent(e) {
         alert("You have pressed a key.");
        }
</script>

<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:TextBox ID="TextBox1" runat="server" Width="209px" onkeypress="return EnterEvent(event)"></asp:TextBox></div>
    </form>
</body>
</html>


这篇关于如何在网页浏览器窗口中加载的网页上加载文本字段时获取消息框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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