vb.net - SelectedIndex is set to 1, after being set to 0 -


Text after "

I have a code where it checks, then the previous item is selected and then to the first one Going off, the loop has been created; Private sub Main_KeyDown handles FilesBox.KeyDown (as the System.Object, as E. KeyEventArgs), then FilesBox.SelectedIndex = FilesBox.Items.Count -. Last is 1 after the last + = 1 = 1 then the last = 0 FilesBox.SelectedIndex = 0 end if end then End Sub

the last item value is selected when the "last", 1 When it will increase, when you have pressed the right key first time when you select it and after you press it again, then it will go to the first item.

It works as well as intended but after any kind of index is set to 0, it does not change from 1 to any other item in the list ... any idea which Its going on?

You have stopped controlling that key processing processing. After you set the index to zero, the keyboard action is still moving the item down one line:

  private sub filesBox_KeyDown (as the object, e) as KeyEventArgs _ FilesBox.KeyDown then handles FilesBox SelectedIndex = FilesBox.Items.Count - 1 Then FilesBox.SelectedIndex = 0 e.SuppressKeyPress = True End then End Sub    

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -