Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3614
  • Last Modified:

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
0
phillll
Asked:
phillll
  • 3
  • 3
  • 2
2 Solutions
 
Bob LearnedCommented:
Me.Cursor = Cursors.WaitCursor

Bob
0
 
Bob LearnedCommented:
Ooh, I just thought of something:  ASP.NET or WinForms?  

"while the page is loading..."

Bob
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

  • 3
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now