newbie: change cursor image at runtime

  • Thread starter Thread starter steve
  • Start date Start date
S

steve

Hi,
I dont know if I am looking at the wrong places but i couldnt find the
appropriate method/property to change the cursor icon at run time.

All i want to do is replace the pointer with an hourglass while the user is
waiting for a datagrid to be populated.

BTW If I want to add a progress bar, how can i set the maximum since the
number of entries depends on the SQL query, and i do not know beforehand. Is
there a way around that ?

TIA
steve
 
Hi Steve!

I dont know if I am looking at the wrong places but i couldnt find the
appropriate method/property to change the cursor icon at run time.

All i want to do is replace the pointer with an hourglass while the user
is
waiting for a datagrid to be populated.

Did you try:

'hourglass
Me.Cursor = Cursors.WaitCursor
System.Threading.Thread.Sleep(1000)
'normal
Me.Cursor = Cursors.Default
BTW If I want to add a progress bar, how can i set the maximum since the
number of entries depends on the SQL query, and i do not know beforehand.
Is
there a way around that ?

Use ProgressBar.Maximum and set it at runtime.

Cheers

Arne Janning
 
Thanx for the fast respons !!!

However when it comes to the progress bar:
I knoe the property and i have used it, but in this case i do NOT know
*beforehand* the total number of entries that will be contained in order to
set prgBar.Maximum = maxnumber
Is there a way around this?

Thanx again
steve
 
steve said:
However when it comes to the progress bar:
I knoe the property and i have used it, but in this case i do NOT know
*beforehand* the total number of entries that will be contained in order
to
set prgBar.Maximum = maxnumber
Is there a way around this?

You can use an SQL query ('SELECT COUNT(*) FROM Foo'), where 'Foo' is the
name of your table, in order to get the number of rows in the table.
 
Hi Steve!

However when it comes to the progress bar:
I knoe the property and i have used it, but in this case i do NOT know
*beforehand* the total number of entries that will be contained in order
to
set prgBar.Maximum = maxnumber
Is there a way around this?

If you absolutely don't know what your maximum number will be then you can
use a progress-bar in marquee-mode:
http://dotnet.mvps.org/dotnet/faqs/?id=marqueeprogressbar

Cheers

Arne Janning
 
Steve,

Setting the cursor as you do is one of the best things you can do, you can
as well make (as well) a splash screen or even one with an avi on it.

However you cannot use with a fill dataset the progressbar. As Herfried
showed you, can you find how many records it are, however not the progress

For a progressbar you needs 3 things, the start, the steps and the end.

You have only 2 of them.

(It can be done while updating because there is an event row by row).

I hope this helps?

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top