473,574 Members | 2,655 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

disable delete key

hi,
i have a richtextbox and i want to prevent the user from deleting its
contents by using the delete key (keys.delete). How can this be achieved ? (
i guess the same would apply for textbox or combobox controls)

thx;)
Nov 21 '05 #1
5 9339
How about making it readonly? Use the RichTextBox.Rea dOnly propery.

"juststarte r" <ju*********@di scussions.micro soft.com> wrote in message
news:CC******** *************** ***********@mic rosoft.com...
hi,
i have a richtextbox and i want to prevent the user from deleting its
contents by using the delete key (keys.delete). How can this be achieved ? (
i guess the same would apply for textbox or combobox controls)

thx;)
Nov 21 '05 #2
private void richTextBox1_Ke yDown(object sender,
System.Windows. Forms.KeyEventA rgs e) {

if(e.KeyValue == 46)e.Handled = true;

}
--
W.G. Ryan, MVP

www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com
"juststarte r" <ju*********@di scussions.micro soft.com> wrote in message
news:CC******** *************** ***********@mic rosoft.com...
hi,
i have a richtextbox and i want to prevent the user from deleting its
contents by using the delete key (keys.delete). How can this be achieved ? ( i guess the same would apply for textbox or combobox controls)

thx;)

Nov 21 '05 #3
Private sub richTextbox1_Ke ydown (byval sender as object, byval e as
System.Windows. Forms.KeyEventA rgs)
if e.KeyValue = 46 then
e.Handles = true
end if

Only translated nothing added or deleted
:-)

Cor
private void richTextBox1_Ke yDown(object sender,
System.Windows. Forms.KeyEventA rgs e) {

if(e.KeyValue == 46)e.Handled = true;

}
--
W.G. Ryan, MVP

www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com
"juststarte r" <ju*********@di scussions.micro soft.com> wrote in message
news:CC******** *************** ***********@mic rosoft.com...
hi,
i have a richtextbox and i want to prevent the user from deleting its
contents by using the delete key (keys.delete). How can this be achieved
?

(
i guess the same would apply for textbox or combobox controls)

thx;)


Nov 21 '05 #4
Thanks Cor ;-) I forgot this was the VB Group.

--
W.G. Ryan, MVP

www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com
"Cor Ligthert" <no************ @planet.nl> wrote in message
news:eN******** ******@tk2msftn gp13.phx.gbl...
Private sub richTextbox1_Ke ydown (byval sender as object, byval e as
System.Windows. Forms.KeyEventA rgs)
if e.KeyValue = 46 then
e.Handles = true
end if

Only translated nothing added or deleted
:-)

Cor
private void richTextBox1_Ke yDown(object sender,
System.Windows. Forms.KeyEventA rgs e) {

if(e.KeyValue == 46)e.Handled = true;

}
--
W.G. Ryan, MVP

www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com
"juststarte r" <ju*********@di scussions.micro soft.com> wrote in message
news:CC******** *************** ***********@mic rosoft.com...
hi,
i have a richtextbox and i want to prevent the user from deleting its
contents by using the delete key (keys.delete). How can this be achieved ?

(
i guess the same would apply for textbox or combobox controls)

thx;)



Nov 21 '05 #5
thx guys ;-)

"W.G. Ryan eMVP" wrote:
Thanks Cor ;-) I forgot this was the VB Group.

--
W.G. Ryan, MVP

www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com
"Cor Ligthert" <no************ @planet.nl> wrote in message
news:eN******** ******@tk2msftn gp13.phx.gbl...
Private sub richTextbox1_Ke ydown (byval sender as object, byval e as
System.Windows. Forms.KeyEventA rgs)
if e.KeyValue = 46 then
e.Handles = true
end if

Only translated nothing added or deleted
:-)

Cor
private void richTextBox1_Ke yDown(object sender,
System.Windows. Forms.KeyEventA rgs e) {

if(e.KeyValue == 46)e.Handled = true;

}
--
W.G. Ryan, MVP

www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com
"juststarte r" <ju*********@di scussions.micro soft.com> wrote in message
news:CC******** *************** ***********@mic rosoft.com...
> hi,
> i have a richtextbox and i want to prevent the user from deleting its
> contents by using the delete key (keys.delete). How can this be achieved> ?
(
> i guess the same would apply for textbox or combobox controls)
>
> thx;)



Nov 21 '05 #6

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

Similar topics

5
5908
by: Greg | last post by:
I am developing an application where I need to secure a workstation for periods of time. I can use BlockInput to stop users from task switching or messing with the keyboard, but I would like to disable Ctrl-Alt-Delete. It seems there seems to be only one real way I know about: Write a replacement Gina Driver to eat the keyboard events I...
1
1693
by: ziad dodin | last post by:
how to disable the DELETE key in a gatagrid control without having to make the datagrid as READ-ONLY; I wander if there is a code to diable this key because it is very dangerous in master detail relations where the user presses the delete key and all rows and child rows disappear; It could be easily handled by ignoring the deletions of the...
4
3121
by: Brad | last post by:
Hello All, I am working on a kiosk application for a library. I do not want users to be able to hit Ctrl-Alt-Delete and exit the kiosk application. I did some searching on the web but did not find much. Is there a way to Disable Ctrl-Alt-Delete? Thanks Brad
1
2920
by: Geroge D. Lake | last post by:
Hi, I need to disable the resizing of a datagrid. I have tried al day and no luck. Any Ideas? Thanks. George.
1
1932
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...
1
2704
by: keithb | last post by:
I have a GridView control that has a delete button (hyperlink) in one column. The datasource table contains a column that has a true/false indicator showing whether or not the record can be deleted. How can I enable/disable the delete button depending on the value of the indicator? Ideally, I would like to make the button invisible where a...
0
1495
by: TT | last post by:
Hello. I'm working in asp.net and i need to disable the edit/delete functionality from a frmview component. help me.thang you! my ACL sub: Protected Sub Page_Load(ByVal sender As Object, ByVal e As
3
1934
by: halimunan | last post by:
hi all, i have this program that will run and the result is based on the .config file. how do i disable the code from the config file ? for example... i want some method to not functioning when i change the variable in the config file.. e.g:
3
11631
by: Pietro | last post by:
Hi all, First of all I'd like to thank you very very much ,as finally after many years of searching,I could find a code to disable/enable the shift key,but actually i cannot use the code as I'm very new to VBA,i tried to follow the instructions reported in the code,but i got no result,i still can use the shift key,can you explain in details...
3
3913
by: Bob Alston | last post by:
Anyone know how to disable or redefine the Ctrl - hotkey which deletes a record? I have a multi page form that uses 14 records, each record handles 1-2 pages of the 18 page form. Occasionally , after being there initially, one of the records becomes deleted. I have found I can cause this by pressing CTRL and the MINUS key simultaneously. ...
0
8249
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7826
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...
0
8107
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...
0
6464
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...
1
5631
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...
0
5307
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...
0
3748
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...
0
3756
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1352
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.