910211-未触发onmousedown [英] 910211 - onmousedown is not triggered

查看:170
本文介绍了910211-未触发onmousedown的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨 我的应用程序是Silverlight类型.我想在用户单击浏览器的边框时触发.为此,我使用了以下方法:

  public  MainPage()
{
    InitializeComponent();
     bool  bResult = System.Windows.Browser.HtmlPage.Window.AttachEvent("  EventHandler( this  .eventHandler));
}

私有 无效 eventHandler(对象发​​件人,EventArgs e)
{
    ...
} 


但未调用eventHandler.为什么?
ps1.如果我将"onmousedown"更改为"onresize",则称为.
ps2. bResult在两种情况下都是正确的.

解决方案

单击边框不会生成onmousedown事件.边框不属于浏览器Windows客户区域,因此不会生成任何事件.但是,如果您调整窗口的大小,则工作区也将发生变化,因此根元素的容器也将重新调整大小,从而触发onresize事件.

希望能把它清除一下!

干杯!


hi my application is of type Silverlight. i want to trigger when user clicks on the border of the browser. for this purpose, i used this method:

public MainPage()
{
    InitializeComponent();
    bool bResult = System.Windows.Browser.HtmlPage.Window.AttachEvent("onmousedown", new EventHandler(this.eventHandler));
}

private void eventHandler(object sender, EventArgs e)
{
    ...
}


but the eventHandler is not called. why?
ps1. if i change "onmousedown" to "onresize" it''s called.
ps2. bResult is true in both cases.

解决方案

Clicking on the border will not generate an onmousedown event. The border does not belong to browser windows client area so no event will be generated. If you resize the window though, the client area will also change and thus the container for the root element resizes which triggers an onresize event.

Hope that clears it up a bit!

Cheers!


这篇关于910211-未触发onmousedown的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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