473,698 Members | 2,178 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How can I differentiate between the delete and "." key (keycode 46)?

4 New Member
Hi all,

Here is my code,

Expand|Select|Wrap|Line Numbers
  1. if(event.which)
  2.    keycode = event.which;//For Mozilla 
  3. else
  4.    keycode = event.keyCode;//For IE
  5.  
But my problem is, the value of keycode returns 46 for pressing "DELETE" key and "." key.

How can I differentiate this?

Please help me with code in both the browsers.

Thanks for all the help.

Regards,
Suresh.
Oct 25 '05 #1
1 2165
acoder
16,027 Recognized Expert Moderator MVP
Use 190 for the "." key.
Oct 1 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
4618
by: Paul | last post by:
I have an Access 2000 database with a form that is giving me some major headaches. When you open the form, it displays all records and allows editing, but has AllowAdditions set to False so that the user has to use my New Record button. When you click the New Record button, the form presents a new record for editing. My client wants to use the Escape key to cancel changes to new or existing records. On existing records, Access already...
0
2266
by: Suzanne | last post by:
I'd like to know how can I put up a confirmation question when the user tries to delete a row in the datagrid by clicking on the row header and pressing the Delete key? I have found this code on a windows forms FAQ site : Public Class DataGrid_Custom Inherits DataGrid Private Const WM_KEYDOWN = &H100
0
1062
by: Agnes | last post by:
After the user delete the row, I need to re-calculate the whole datagrid's invoice amount, So I try the following code. but I am fail. Does anyone know how to do that ? I try the datagrid.rowchanged/ validated event.. etc. BUT it seems didn't fired (If I press delete ) Public Overrides Function PreProcessMessage(ByRef msg As System.Windows.Forms.Message) As Boolean Dim keyCode As Keys = CType((msg.WParam.ToInt32 And Keys.KeyCode),
2
1661
by: Lars Netzel | last post by:
Hi What events are there to do things in when I am on a row in a datagrid (bound from a dataset) and press Delete key... There's no Delete Event on the drig and I can't figure out if there are any events on the Dataset itself either.. I need to delete a row from the database when this happens
1
1939
by: johnb41 | last post by:
I have a datagrid that successfully allows editing and updating (with dataadapter.update command). I want the user to be able to edit the "text" in the datagrid, but i DON'T want the user to be able to DELETE rows. The OleDbCommandBuilder automatically creates the DELETE SQL statement. Is there any way I can disable it? If not, what approach should I be using? Thanks!
9
34770
by: Laphan | last post by:
Hi All I'm using the below to limit the input into a text box to just letters, numbers, hyphens and full stops, but I also need to allow the backspace, delete and arrow keys to come through. How can I do this? <script language="JavaScript" type="text/javascript"> <!-- function onKeyPressBlockNumbers(e) {
7
8218
by: Jo | last post by:
Hi, How can i differentiate between static and dynamic allocated objects? For example: void SomeFunction1() { CObject *objectp = new CObject; CObject object;
3
11712
by: gouthambu | last post by:
Hi all, I have a javascript to limit the text entry in a text area after the size reaches 300 (only thing that should be allowed is left arrow,up arrow, right arrow 39,down arrow,delete and backspace ) when i wrote the following script it works fine in firefox but in IE there is a problem. The problem comes in IE from the fact that the keyboard code and the character code overlap each other, and the character code for the period character is...
9
5520
by: Greg (codepug | last post by:
I have a combobox with the RowSourceType set to Table/Query and the RowSource is an SQL query that references a separate lookup table that contains the data that can be selected in the combobox. Also, limittolist & autoexpand are set to Yes. Control source is set to the main table field where the data will go. I can highlight the data that was previously selected in the combobox, and press the delete key to remove it, but after I move...
0
8604
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9160
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
8897
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
8862
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...
1
6521
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
5860
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
4619
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2331
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2002
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.