Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / VB.NET / October 2004

Tip: Looking for answers? Try searching our database.

newbie: change cursor image at runtime

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
steve - 17 Oct 2004 20:15 GMT
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
Arne Janning - 17 Oct 2004 20:30 GMT
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
steve - 17 Oct 2004 20:43 GMT
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
> Hi Steve!
>
[quoted text clipped - 23 lines]
>
> Arne Janning
Herfried K. Wagner [MVP] - 17 Oct 2004 20:46 GMT
"steve" <noemail.@try.com> schrieb:
> 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.

Signature

Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/

Arne Janning - 17 Oct 2004 20:55 GMT
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
Cor Ligthert - 18 Oct 2004 09:19 GMT
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
"steve" <noemail.@try.com>
..
> Thanx for the fast respons !!!
>
[quoted text clipped - 37 lines]
>>
>> Arne Janning

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.