473,320 Members | 1,978 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

C# App: Stopping ding sound in treeview

I've got a treeview with some items, and I want to catch the keydown events to check if the enter key is pressed. I'm doing this with the treeview's keydown event.

However, every time enter key is pressed in the control, a ding also sounds. How do I get rid of this?

I'm using C# and .NET 2.0.
Nov 26 '07 #1
3 2820
Shashi Sadasivan
1,435 Expert 1GB
Dosent seem to do that on my computer.

however when the enter key is pressed, do u set the e.Handled property to true?
This could subside the crazy ding ding coming through
Nov 26 '07 #2
I tried that, but setting e..Handled to true just caused the treeview to stop responding to other key events.

It's not a huge problem, so I'll live with it. But if anyone knows of a fix, please let me know.
Nov 27 '07 #3
Shashi Sadasivan
1,435 Expert 1GB
Hi,
Being a bit more specific, if you want the tree view to handle the Enter key, then if the enter key is detected, only then should you set the e.Handled to true.

Expand|Select|Wrap|Line Numbers
  1. if(e.KeyData = Keys.Enter)
  2. {
  3.    //Do your code here when enter is pressed
  4.    e.Handled = true;
  5. }
  6. else
  7.    e.Handled = false;
You really dont need the else statement here, but making it clear for you on what you should be handling
Nov 28 '07 #4

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

Similar topics

10
by: Lynn | last post by:
I have a SuSe 9.1 linux box (although this isn't a new issue) with reasonably up to date everything. When I run PySol, it grabs the sound system in a rude and complete way. I don't listen to...
12
by: bj7lewis | last post by:
I am working on a project I want to add a few files as resource to access(copy them to FS and use) at runtime. So far in VS.NET IDE, I Add Files to the project and set its Build Action to...
2
by: Mark Goldin | last post by:
I need to start to work on my first Web apps. in .NET. It will have classic 3-tier architecture. 1. Back-end - SQL Server 2. Middle tier - ?? 3. Browser based interface. Regular static html...
11
by: mareal | last post by:
I am trying to write a basic load balancer (in our web service) solution. The purpose of this load balancer is to keep an array updated with server status. We have several servers that can be...
6
by: Bob | last post by:
I'm trying to prevent the beep when the tab key is pressed. It works ok on XP but windows 2000 is ding ding ding Here is my code: Protected Overrides Function ProcessDialogKey(ByVal keyData As...
11
by: cartercc | last post by:
January, 2006. I do not intend to start any kind of flame war, but only to seek advice about different technologies concerning which I am mostly ignorant. I am the database manager for a unit...
3
by: Lee | last post by:
Hi, I am displaying a messagebox using;- MessageBox.Show("blurb", "more blurb", MessageBoxButtons.OK, MessageBoxIcon.Exclamation) it works ok, and when it shows there is a ding sound, how...
6
by: =?Utf-8?B?VmVybm9uIFBlcHBlcnM=?= | last post by:
I have an application that is designed for using with a bar code scanner. I want the user to know that the scan was complete and the data was entered, so I am playing a system sound after data...
2
by: jiayanxiang | last post by:
Is there some way to programmatically turn off the "Ding" sound when the user presses Enter in a text field?
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.