|
-
Jan 26th, 2004, 01:47 PM
#1
Thread Starter
Fanatic Member
KeyPress event in a text box
In VB 6.0 I could use the following to move the cursor to the next text box if the user hit the Enter key.
VB Code:
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Keyascii = 0
Text2.SetFocus
End If
End Sub
Is there a VB way to use this in .Net for a web page or do you have to use Java or HTML?
Some examples would be greatly apreciated.
Thanks!
-
Jan 26th, 2004, 02:57 PM
#2
Junior Member
You are going to have a few problems with trying to move the cursor with the enter key.
First the enter Key on a Web Page is by default the Submit action
second if you are trying to use VB to capture keypress events you are reposting the data back to the server on every keypress. You should use Java and make it a client side event.
Hope that helps
-
Jan 26th, 2004, 03:47 PM
#3
Thread Starter
Fanatic Member
Well, since I don't know much about Java, that doesn't help at all. I was hoping to see some examples of some code that would do what I need it to do....
-
Jan 26th, 2004, 03:52 PM
#4
Junior Member
Again, I dont think you want to change the enter key. it is the Default Key for submitting a page.
-
Jan 27th, 2004, 08:06 AM
#5
Thread Starter
Fanatic Member
I'm sure you have a valid point. But when the Executive Vice president of the company I work for wants something, I have to do my best to deliver what he wants.
Does anyone know how to get the key pressed on a web page?
-
Jan 27th, 2004, 04:15 PM
#6
Frenzied Member
I know the feeling... I am developing web apps and dll components for a bunch of people that are requesting the craziest stuff... sometimes you have to make them understand that it is IMPOSSIBLE... or convice them that you need additional resources to make it happen (that buy you enough time to learn javascript... hehe)...
This task might not be that difficult... but I have some crazy examples of suggestions... 
happy coding
Henrik
-
Jan 27th, 2004, 06:33 PM
#7
PowerPoster
It is your job to show him EVERY web site on the internet until he gets the point in his head. If he still believes that he should get what he wants, then tell him it is going to cost him some HEAVY R&D money to figure out the best way to do such a thing.
I can't stand it when people don't stand up for this stuff. These are conventions for a reason. This is something that is built into IE, it isn't something you just change for the hell of it.
Tell him/her that it can't be done without a serious investment of time. Put it in dollar values how much it is going to cost them (like your hours times the amount you make plus how much you make for the company if your time was used elsewhere). This is something that will stop an unreasonable request from happening fast! I do it all the time. I tell people to get used to things that are convention based. If they want other than conventions, I show them how much extra it will cost. They stop there....
Another thing, you can probably do this with javascript, you probably don't need Java, but I don't have any examples for you.
-
Jan 28th, 2004, 01:47 AM
#8
Frenzied Member
here here
-
Jan 28th, 2004, 08:31 AM
#9
Junior Member
I agree, I am really tired of being asked for web apps that have Fat client functionality If you want a fat client get a fat client.
tal mcmahon
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|