Click here to Skip to main content
12,354,716 members (58,028 online)
Rate this:
 
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
RX232139
Edited 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.
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
Top Experts
Last 24hrsThis month


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

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100