计时鼠标指针更改 [英] Timing Mouse Pointer changes

查看:72
本文介绍了计时鼠标指针更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个页面,当被调用时,它运行一段时间(~15秒),然后

显示一个DataGrid控件。我想要完成的是让鼠标

指针转到''等待'',然后在控件显示后,返回''默认''。


如果SetWaitPointer()例程将光标更改为等待,

,但在页面上显示数据网格之前,SetDefaultPointer()

运行并将光标更改回默认。这种情况发生在3秒钟左右,因此用户花费12秒钟查看一个空白窗口和一个默认的
鼠标指针。我正在想象'他什么时候会感到不安'不要这么做。不管怎样,我会挂掉,道格感觉。


我已经包含了我用于此的代码的简化版本。任何人都可以将b $ b指向我的解决方案吗?我怎样才能确保

SetDefaultPointer()在控件显示之前不会触发?


谢谢,


Dave


''平台是Visual Studio 2003,在线VB.NET

''函数SetWaitPointer()& SetDefaultPointer()基本上是

javascript

dim sCommand as string =" document.body.style.cursor =''wait'' ;

response.write("< script language = JavaScript>"& sCommand&"<"&

" / script> ;")


Sub Page_Load(发件人作为对象,E作为EventArgs)


SetWaitPointer()


DisplayDatabaseGrid()

SetDefaultPointer()

End Sub

I have a page that, when invoked, it runs a while (~ 15 seconds), then
displays a DataGrid control. What I want to accomplish is to have the mouse
pointer go to ''wait'', then after the control displays, return to ''default''.

What happens is the SetWaitPointer() routine changes the cursor to ''wait'',
but before the data grid is displayed on the page, ''SetDefaultPointer()''
runs and changes the cursor back to ''default''. This happens about 3 seconds
in, so the user spends 12 seconds looking at a blank window and a default
mouse pointer. I''m imagining that''s when he will get that uneasy "Don''t
leave me hanging, Dawg" feeling.

I have included a simplified version of the code I use for this. Can anyone
point me to a solution to this? How can I make sure that
SetDefaultPointer() won''t fire until the control displays?

Thanks,

Dave

''The platform is Visual Studio 2003, in-line VB.NET
''The functions SetWaitPointer() & SetDefaultPointer() are basically
javascript:
dim sCommand as string = "document.body.style.cursor = ''wait''; "
response.write("<script language=JavaScript>" & sCommand & "<" &
"/script>")

Sub Page_Load(Sender As Object, E As EventArgs)

SetWaitPointer()

DisplayDatabaseGrid()

SetDefaultPointer()

End Sub

推荐答案

戴夫,


我没有指导解决方案,因为我做了一段时间没有JavaScript,


不过你是什么正在做的就是当我看到它时。


在服务器端设置等待光标(这对你的

客户端没有影响)

初始化

在服务器端设置默认光标


发送页面。


我简直不敢相信这就是你想要的。


可能你想在从客户端回发之前设置光标到服务器的
并将其设置为默认值n页面再次在

客户端收到。


正如我所说的那样,我手边没有它的片段,也许还有其他人。


Cor
Dave,

I have not direct the solution because I did a while no JavaScript,

However what you are doing is when I see it right.

Set on the serverside the Wait Cursor (this has no effect on your
clientside)
Initialize
Set on the serverside the default Cursor

Sent the page.

I cannot believe that that is what you want.

Probably you want to set the cursor before the postback from the client to
the server and set it to default when the page is again received on the
client.

As I said I have no snippet for it at hand, maybe somebody else.

Cor


你好,Cor。


你的关键词是当页面再次在客户端收到。


我在web开发方面有点新手。我不知道如何确定这个事件
。只是玩游戏,我从我的代码中取出了SetDefaultCursor()

,将其括在<%....%>中,并将其粘贴在
所有的html代码。这很好,除了它意外地使

例程运行62秒而不是15秒。


无论如何,如果你知道我应该看什么为了确定客户收到该页面的时间,我将不胜感激。


再次感谢,


戴夫

" Cor Ligthert" <无************ @ planet.nl>在留言中写道

新闻:%2 ***************** @ tk2msftngp13.phx.gbl ...
Hello, Cor.

The key phrase of yours is "when the page is again received on the client".

I am somewhat of a newbie in web developement. I do not know how to
determine this event. Just playing around, I took the SetDefaultCursor()
out of my code, enclosed it in "<%....%>", and stuck it near the bottom of
all the html code. That worked fine, except that it unexpectedly made the
routine run for 62 seconds instead of 15 seconds.

Anyway, if you know what I should look at to determine when the page is
received by the client, I would appreciate it.

Thanks again,

Dave
"Cor Ligthert" <no************@planet.nl> wrote in message
news:%2*****************@tk2msftngp13.phx.gbl...
戴夫,

我没有指导解决方案,因为我做了一段时间没有JavaScript,

然而你正在做的是当我看到它时。
在服务器端设置等待光标(这对您的
客户端没有影响)
初始化
在服务器端设置默认光标

发送页面。

我无法相信这就是你想要的。

可能你想在从客户端回发服务器之前设置光标并将其设置为默认值当页面再次在
客户端收到时。

正如我所说的那样,我手头没有它的片段,也许还有其他人。

Cor
Dave,

I have not direct the solution because I did a while no JavaScript,

However what you are doing is when I see it right.

Set on the serverside the Wait Cursor (this has no effect on your
clientside)
Initialize
Set on the serverside the default Cursor

Sent the page.

I cannot believe that that is what you want.

Probably you want to set the cursor before the postback from the client to
the server and set it to default when the page is again received on the
client.

As I said I have no snippet for it at hand, maybe somebody else.

Cor



戴夫,


我很快就找到了这个,也许我明天会看,但是没有任何承诺


Button1.Attributes(" onclick")=" document.body.styl e.cursor ='''wait''"


然而它只显示那里没有控件的等待状态,我

认为我知道现在怎么做,但我现在没时间写那个

了。


Cor
Dave,

Quickly I found this, maybe I look tomorrow, however no promish

Button1.Attributes("onclick") = "document.body.style.cursor=''wait''"

However it shows only the wait status there where there are no controls, I
think that I know now how to do it, however I have no time to write that
now.

Cor


这篇关于计时鼠标指针更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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