Click here to Skip to main content
15,884,099 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
Updated 11-Jan-12 23:20pm
v2
Comments
Technoses 12-Jan-12 6:03am    
you should use enter key for next control focus reather than selection or typing.

Hi,

In dropdownbox1_SelectionChanged event and the character limitation function, use the below code

VB
If controltobefocused.CanFocus Then
controltobefocused.Focus()
End If
 
Share this answer
 
v2
Hi Rx232,
There will be an method like dropdownlist_selectedIndexChanged() within the method you can assign the focus to the next control.
C#
protected void ddllist_SelectedIndexChanged(object sender, EventArgs e)
    {
        //write some code to focus on next control
   }


Regards,
Bluesathish
 
Share this answer
 
use js
JavaScript
function kydown()
{ 
if(event.keyCode==13)
{
event.keyCode=9;
return;
}
}


HTML
<body   önkeydown="return kydown();">
</body>


dont forget to rate is it is usefull for you
 
Share this answer
 
v3

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900