473,748 Members | 10,028 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Altering function of keypress for listbox


....still new at this. ...hopefully a simple question

Is there some practical way of altering the function of a keypress in Visual Web.net 2005 using VB without causing a postback on
each keypress? For example: A have a listbox with a number of selections. The up and down keyboard keys change the indicated listbox
selection and by default the <tabkey takes the focus away from the listbox and onto a button that will submit the selection. I'm
attempting to also have the <enterkey take the focus away from the listbox and onto the button, so that two pushes on the <enter>
key will submit the listbox selection (a drop down list will act in this manner by default).

Is this possible?

Thanks

Jeff

--
Posted via a free Usenet account from http://www.teranews.com

Aug 7 '06 #1
4 2799
Jeff,
If its possible, I suspect it would be, you would need to use Javascript to
do it. Unfortunately Javascript is not my strong point.

I would recommend you ask "down the hall" in one of the
microsoft.publi c.dotent.framew ork.aspnet.* newsgroups.

--
Hope this helps
Jay B. Harlow [MVP - Outlook]
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net
"Jeff" <no**@none.comw rote in message
news:44******** *************** @free.teranews. com...
|
| ...still new at this. ...hopefully a simple question
|
| Is there some practical way of altering the function of a keypress in
Visual Web.net 2005 using VB without causing a postback on
| each keypress? For example: A have a listbox with a number of selections.
The up and down keyboard keys change the indicated listbox
| selection and by default the <tabkey takes the focus away from the
listbox and onto a button that will submit the selection. I'm
| attempting to also have the <enterkey take the focus away from the
listbox and onto the button, so that two pushes on the <enter>
| key will submit the listbox selection (a drop down list will act in this
manner by default).
|
| Is this possible?
|
| Thanks
|
| Jeff
|
|
|
|
|
| --
| Posted via a free Usenet account from http://www.teranews.com
|
Aug 7 '06 #2
Jeff,

Not despite but in addition of Jay's answer, I think you will hardly find
any JavaScript for this.

If needed you can add it in VBNet, using the addattributes or
registratejavas cript attributes. But you will probably not find good
Javascript, The reason is that you try to change the standard behaviour of
all the mozila compatible browser UI, something we are so glad of that it
exist.

This means that all or at least most of your current website users will hate
you shorter or later and try to avoid your website.

Just my thougth reading Jays message and thinking why I did not give an
answer on your question.

Cor
"Jeff" <no**@none.coms chreef in bericht
news:44******** *************** @free.teranews. com...
>
...still new at this. ...hopefully a simple question

Is there some practical way of altering the function of a keypress in
Visual Web.net 2005 using VB without causing a postback on
each keypress? For example: A have a listbox with a number of selections.
The up and down keyboard keys change the indicated listbox
selection and by default the <tabkey takes the focus away from the
listbox and onto a button that will submit the selection. I'm
attempting to also have the <enterkey take the focus away from the
listbox and onto the button, so that two pushes on the <enter>
key will submit the listbox selection (a drop down list will act in this
manner by default).

Is this possible?

Thanks

Jeff

--
Posted via a free Usenet account from http://www.teranews.com

Aug 7 '06 #3
Cor,
| If needed you can add it in VBNet, using the addattributes or
| registratejavas cript attributes. But you will probably not find good
| Javascript, The reason is that you try to change the standard behaviour of
| all the mozila compatible browser UI, something we are so glad of that it
| exist.
I agree. Mozila, vs IE 6-, IE 7+, vs Opera, vs whatever may mean he will
need browser specific Javascript. Or worse specific browsers may just not
support it.

He should be able use Request.Browser to find out which browser, what
version of browser, what version of DOM, what version of Javascript... the
client is using:

http://msdn2.microsoft.com/en-us/lib...t.browser.aspx
Rather then avoid a feature I try to ensure that it "degrades gracefully".
For example I use Request.Browser on my web site to decide if copying on my
samples pages is supported: IE gets the copy button, Firefox doesn't. As the
copy button uses IE specific functionality. (If you have Firefox et al copy
to clipboard java script I would love to use it).

Although I agree, I might avoid his site if his web select control didn't
behave as other web select controls...

Reading his message just now, wont making the button the "submit" button
cause it to submit the page? Without needing to add code. I may need to
review this closer tonight.

--
Hope this helps
Jay B. Harlow [MVP - Outlook]
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net
"Cor Ligthert [MVP]" <no************ @planet.nlwrote in message
news:OZ******** ******@TK2MSFTN GP02.phx.gbl...
| Jeff,
|
| Not despite but in addition of Jay's answer, I think you will hardly find
| any JavaScript for this.
|
| If needed you can add it in VBNet, using the addattributes or
| registratejavas cript attributes. But you will probably not find good
| Javascript, The reason is that you try to change the standard behaviour of
| all the mozila compatible browser UI, something we are so glad of that it
| exist.
|
| This means that all or at least most of your current website users will
hate
| you shorter or later and try to avoid your website.
|
| Just my thougth reading Jays message and thinking why I did not give an
| answer on your question.
|
| Cor
|
|
| "Jeff" <no**@none.coms chreef in bericht
| news:44******** *************** @free.teranews. com...
| >
| ...still new at this. ...hopefully a simple question
| >
| Is there some practical way of altering the function of a keypress in
| Visual Web.net 2005 using VB without causing a postback on
| each keypress? For example: A have a listbox with a number of
selections.
| The up and down keyboard keys change the indicated listbox
| selection and by default the <tabkey takes the focus away from the
| listbox and onto a button that will submit the selection. I'm
| attempting to also have the <enterkey take the focus away from the
| listbox and onto the button, so that two pushes on the <enter>
| key will submit the listbox selection (a drop down list will act in this
| manner by default).
| >
| Is this possible?
| >
| Thanks
| >
| Jeff
| >
| >
| >
| >
| >
| --
| Posted via a free Usenet account from http://www.teranews.com
| >
|
|
Aug 8 '06 #4

"Jay B. Harlow [MVP - Outlook]" <Ja************ @tsbradley.netw rote in message news:%2******** ********@TK2MSF TNGP02.phx.gbl. ..
>
Although I agree, I might avoid his site if his web select control didn't
behave as other web select controls...

Reading his message just now, wont making the button the "submit" button
cause it to submit the page? Without needing to add code. I may need to
review this closer tonight.

--
Hope this helps
Jay B. Harlow [MVP - Outlook]

I should clarify that this was intended not for a public use web site, but rather for something very specific to use for collecting
data from people who were invited (and paid) to participate. I'm attempting to take them as rapidly as possible through a series of
questions/answers without jumping from the keyboard to the mouse and back again. It isn't practical to install an application on
their machines, so we are using a browser based interface. So yes, you are correct that this would not generally be a good idea for
another use.

Jeff


--
Posted via a free Usenet account from http://www.teranews.com

Aug 8 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
1699
by: Joneseyboy | last post by:
Hi, I'm new to this so I could really do with some help! I am using VB.net to create a small game. basically there is a Textbox, a button and a listbox. The user enters a number into the textbox which is then validated against a random number which is generated using the Rnd function. When the user clicks the button, they either get a message saying Too Low, Too High or Spot On.
3
5197
by: Scott | last post by:
I have a function named MyFunction in a standard module that creates a semi-colon delimited list. I want to use this list for the value list in a listbox. I have the row source type property set to Value List. Can I use the function, MyFunction, as the row source of the listbox? I have tried =MyFunction and just MyFunction and in each case the listbox shows =MyFunction or MyFunction like it is the first choice in the listbox rather than...
0
1238
by: Keith Smith | last post by:
Let's say that I have these items in my listBox... Monday Tuesday Wednesday Thursday Friday ....and then I press "T". The selector will automatically move to "Tuesday". How can I keep this from happening? (I can't set the Selection Mode to none
4
4531
by: Tom | last post by:
I have a VB.NET user control that I wrote - this control has three or four other controls on it (textbox, combobox, datetime picker, etc). Now, whenever the control is on a form and the user enters anything into the textbox (for instance) I trap the keypress event to handle some stuff (i.e. if it is an enter key, etc). Now, once I am done with handling the keypress event for the textbox, I then need to pass that keypress event BACK to the...
5
59024
by: pa2ratczi | last post by:
Hi everyone,,, Can someone tell me, how to use the KeyPress Function? what is the command for a KeyPress function? thank you
11
1984
by: The Frog | last post by:
Hi all, Maybe I am just missing something simple here, but I seem to have an issue with a callback function in A97 that is used to fill a Listbox with values. The first time the callback function is used (when the form opens) all runs well and everyone is happy. Then comes the problem - values are added to the recordset (ADO) that the callback function uses to populate the listbox. After the new values are added to the recordset, the...
1
1339
by: John Smith | last post by:
Hello, I'd like to create a function that will allow users to only enter numbers in some textboxes. I'm trying to create only one function and call it for each textbox.keypress event instead of creating one for each textbox. This is what I have (and works): Private Function DigitsOnly(ByVal sender As System.Object, ByVal e As
1
1236
by: kairs86 | last post by:
how can i bind the listbox on keypress events.......
2
7715
by: svibuk | last post by:
i have a asp.net list box populated with databae data , autopostback = true wht i need is 1) when double clicked(double click event) i want it to be visible=false 2)i want to move between the data in the listbox using up, down arrow keys & make the selection by pressing eneter(keypress event) 3) everytime i move betwen the data(autopostback = true) postback is caused,is it possible to avoid the flickering without ajax as if i have to...
0
8984
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9530
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9312
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9238
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8237
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6793
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6073
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4593
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3300
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.