how to change the cursor to an hour-glass

hi all,
in VB.NET i have 2 radio buttons, one is already selected. When i select the other one the buttons event triggers some code that connects to the databse and this takes a while..

how can i change the cursor to an hour-glass while the page is loading and then change it back to normal when it is finished?

Thanks a lot
phillllAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bob LearnedCommented:
Me.Cursor = Cursors.WaitCursor

Bob
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Bob LearnedCommented:
Ooh, I just thought of something:  ASP.NET or WinForms?  

"while the page is loading..."

Bob
0
Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

phillllAuthor Commented:
winforms it is

can i just through this at you before i go for lunch?

i get an error:
Specified argument was out of the
range of valid values.

with this

If Me.lv.Items.Count > 0 Then
                lv.Select()
                lv.Items(iSelected).Selected = True
                lv.Items(iSelected).Focused = True
                lv.Items(iSelected).EnsureVisible()
            End If

on this line:
lv.Items(iSelected).Selected = True

where lv is a listview
iSelected = 1393 and
Me.lv.Items.Count  = 1390

any ideas?

i'll increase the points if it is answered.
Thanks again
0
armoghanCommented:
phillll,
how can iSelected be greater than Me.lv.Items.Count?


0
armoghanCommented:
check iSelected value where you are changing it and dont let it exceed count.. or add a condition to if statment which checks the iselected < Me.lv.Items.Count
0
phillllAuthor Commented:
sorry i meant to say
Me.lv.Items.Count = 1393

ahh yes cos' i guess if
Me.lv.Items.Count = 1393
then it can only hold 1392 elements

does a listview start from an index of '0'?
0
Bob LearnedCommented:
Yes, most things in VB.NET are zero-based.  ListBox items is one of those.

Bob
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.