Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Javascript.NET
I am new to VB.net
I am developing an application screen. In that screen I have many controls like text box, drop down etc. For text boxes some charcter limit I have set. My requirement is that when i select an item from drop down(either using mouse or key board), the focus should go to next control after this drop down. When i enter some value in the text box, after reaching the charcater limit, the focus should automatically be on the next control. How is this possible in VB.net.
Is it possible using java script?
 
Thanks for the help
___RX23___
Posted 11-Jan-12 22:13pm
RX232138
Edited 11-Jan-12 23:20pm
v2
Comments
Technoses at 12-Jan-12 6:03am
   
you should use enter key for next control focus reather than selection or typing.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Hi,
 
In dropdownbox1_SelectionChanged event and the character limitation function, use the below code
 
If controltobefocused.CanFocus Then
controltobefocused.Focus()
End If
  Permalink  
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Hi Rx232,
There will be an method like dropdownlist_selectedIndexChanged() within the method you can assign the focus to the next control.
protected void ddllist_SelectedIndexChanged(object sender, EventArgs e)
    {
        //write some code to focus on next control
   }
 
Regards,
Bluesathish
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

use js
function kydown()
{ 
if(event.keyCode==13)
{
event.keyCode=9;
return;
}
}
 
<body   önkeydown="return kydown();">
</body>
 
dont forget to rate is it is usefull for you
  Permalink  
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 Guruprasad.K.Basavaraju 390
1 Shai Vashdi 349
2 Sergey Alexandrovich Kryukov 325
3 OriginalGriff 265
4 Peter Leow 171
0 Sergey Alexandrovich Kryukov 8,979
1 OriginalGriff 5,280
2 Peter Leow 4,010
3 Maciej Los 3,535
4 Abhinav S 3,263


Advertise | Privacy | Mobile
Web02 | 2.8.140415.2 | Last Updated 12 Jan 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Use
Layout: fixed | fluid