473,657 Members | 2,707 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Timing Mouse Pointer changes

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, 'SetDefaultPoin ter()'
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
SetDefaultPoint er() won't fire until the control displays?

Thanks,

Dave

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

Sub Page_Load(Sende r As Object, E As EventArgs)

SetWaitPointer( )

DisplayDatabase Grid()

SetDefaultPoint er()

End Sub
Nov 21 '05 #1
15 1511
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
Nov 21 '05 #2
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 SetDefaultCurso r()
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******** *********@tk2ms ftngp13.phx.gbl ...
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

Nov 21 '05 #3
Dave,

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

Button1.Attribu tes("onclick") = "document.body. style.cursor='w ait'"

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
Nov 21 '05 #4
Thank you, Cor. I have used this method (Button1.Attrib utes.....) in the
past, but I don't know how to make it work for my present problem.

If I am reading between the lines correctly, you may have a solution
forthcoming. If so, I am patient - I can wait.

I think there is probably some trappable event, but I don't know what it
would be. I know the page knows - because the cursor changes to 'Working in
Background' when you touch the browser's border with the cursor.

Thanks again,

Dave

"Cor Ligthert" <no************ @planet.nl> wrote in message
news:ed******** ******@TK2MSFTN GP12.phx.gbl...
Dave,

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

Button1.Attribu tes("onclick") = "document.body. style.cursor='w ait'"

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

Nov 21 '05 #5
Dave,

In my opinion does this one what you ask.
\\\
Private Sub Page_Load(ByVal sender As System.Object, _
ByVal e As System.EventArg s) Handles MyBase.Load
Button1.Attribu tes("onclick") = _
"for (var i=0;i < document.all.le ngth; i++)
document.all(i) .style.cursor = 'wait';"
Dim str As String
End Sub
///
I hope this helps a little bit?

Cor

Nov 21 '05 #6
Well, thank you Cor, but that doesn't do it. I want this to happen without
button clicks.

Someday, I'll either get better at this and figure it out, or I'll browse
onto a page that does it, and maybe by viewing the code or asking the
author, I'll get it.

I appreciate you taking time out for this little problem of mine.

Dave

"Cor Ligthert" <no************ @planet.nl> wrote in message
news:OH******** ******@TK2MSFTN GP12.phx.gbl...
Dave,

In my opinion does this one what you ask.
\\\
Private Sub Page_Load(ByVal sender As System.Object, _
ByVal e As System.EventArg s) Handles MyBase.Load
Button1.Attribu tes("onclick") = _
"for (var i=0;i < document.all.le ngth; i++)
document.all(i) .style.cursor = 'wait';"
Dim str As String
End Sub
///
I hope this helps a little bit?

Cor

Nov 21 '05 #7
Dave,

What is than the action that does the return?

Cor
Nov 21 '05 #8
Cor,

This is what I think happens:

First My code. All is in Page_Load(), and all should happen automatically -
the page's only purpose is to hold and display the data grid.

1) Set Cursor Wait
2) Run a 15 second procedure
3) Set Cursor Default

What happens is while the user is waiting for step 2 to complete, step 3
kicks in after only 3 seconds, and the cursor goes back to default for 12
seconds, then the data grid displays.

I think the reason for this is that the actual 15 second procedure takes 3
seconds for the database operation, and it takes the browser 12 seconds to
process the information it gets from the server. But since the server is
done, it sends the reset cursor statement prematurely. If there was some
way I could capture when the browser actually rendered the data grid, I
think I would have it. But I don't know enough client-server programming to
do that. Someday I will ....

Thanks,
Dave

"Cor Ligthert" <no************ @planet.nl> wrote in message
news:OP******** ********@TK2MSF TNGP15.phx.gbl. ..
Dave,

What is than the action that does the return?

Cor

Nov 21 '05 #9
Dave,

Did you include the code I have in the previous message.
In that is not a setting to default.

In my test it did work.

\\\needs only a button on a form
Private Sub Page_Load(ByVal sender As System.Object, _
ByVal e As System.EventArg s) Handles MyBase.Load
Button1.Attribu tes("onclick") = _
"for (var i=0;i < document.all.le ngth; i++)" & _
" document.all(i) .style.cursor = 'wait';"
Dim str As String
End Sub
Private Sub Button1_Click(B yVal sender As System.Object, _
ByVal e As System.EventArg s) Handles Button1.Click
Threading.Threa d.Sleep(15000)
End Sub
///

Cor
Nov 21 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
9044
by: Videos 4 Sale | last post by:
Would you know how to change the look of a mouse pointer on a web page. On the page I have the mouse pointer is exactly as I have at work.... white. But what I want to do is change the look of it so that the people who visit the web page see a neon arrow (example) as opposed to what they see now (which is the white arrow) Any Ideas? Its driving me batty. Many thanks
5
7942
by: gsb | last post by:
I track the mouse location like this code: function mousePos(e) { var p = new Object(); if(e) { p.x = e.pageX; p.y = e.pageY; } else { p.x = event.x; p.y = event.y; } ... (show) } document.onmousemove=mousePos; Seems to do fine on many browsers.
9
4869
by: DotNetShadow | last post by:
Hi Guys, I have been having this problem recently where I have a form with a textbox and button, if in the button event I have the following: Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Me.Cursor = Cursors.WaitCursor Textbox1.text = Now.Tostring System.Threading.Thread.Sleep(2000) ' 2 second wait
1
4162
by: Stefan Mueller | last post by:
With the following code I can change the mouse pointer. However, if you click in Mozilla (with IE it works perfect) on 'Show hourglass' the mouse pointer changes only if you move the mouse at least on pixel. <html> <body> <script type = 'text/javascript'> function show_hourglass() { document.getElementById("my_href1").style.cursor = "wait"; document.getElementById("my_href2").style.cursor = "wait";
0
1323
by: ManConfusedByMouse | last post by:
Hi all, I AM HAVING PROBLEMS UNDERSTANDING THE UPDATING BEHAVIOR/TIMING OF A WINDOWS.FORMS.SCROLLBAR COMPONENT... quick apology for my sorry posterior if posting in wrong place -- haven't much experience with these groups, and can find nothing more specific than csharp. my program manually sets up some synchronization between the user's mouse , some bitmaps viewable on container's surface
2
16298
by: diatom | last post by:
Hello, I have a custom dialog. When the user hits the 'Ok' button, I want my mouse to turn into an hourglass while its performing work - and then I want it to go back to normal afer the work is finished. In C# and Windows projects, how I can I control the look of the mouse? Thanks
1
4615
by: Narcolessico | last post by:
Hi, I'm writing on Linux an application which needs to move the mouse pointer and simulate button clicks (better: button press and release events separately, e.g. to do drag&drop). I found several ways to move the pointer: - Using QT QCursor::setPos - Using SDL libraries .... - Using XLib directly
2
3726
by: =?Utf-8?B?UmFqbmVlc2ggTmFyYWlu?= | last post by:
Hi, I have a ComboBox in a Windows app (.net2.0). And when users start typing into it, the dropdown populates itself from a webservice and gives relevant options under it... But the mouse hides itself, os its very hard to know what you are selecting. The reason for mouse hiding itself is because in Control Panel >Mouse >> Pointer Options >Hide pointer while typing is checked.
18
16852
Alireza355
by: Alireza355 | last post by:
Dear friends, I have a command button that when clicked, runs tens of queries, millions of calculations, etc. This process takes about 10 seconds each time, and the mouse pointer rapidly changes into hourglass and changes back to pointer during this process. If the user opens other forms or does other things while the main calculations are not finished yet, the results would be disaster. So I want to disarm the user by disabling mouse...
0
8394
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8825
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8732
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8503
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8605
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6164
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5632
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1955
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.