473,503 Members | 9,887 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 9313
How about making it readonly? Use the RichTextBox.ReadOnly propery.

"juststarter" <ju*********@discussions.microsoft.com> wrote in message
news:CC**********************************@microsof t.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_KeyDown(object sender,
System.Windows.Forms.KeyEventArgs e) {

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

}
--
W.G. Ryan, MVP

www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com
"juststarter" <ju*********@discussions.microsoft.com> wrote in message
news:CC**********************************@microsof t.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_Keydown (byval sender as object, byval e as
System.Windows.Forms.KeyEventArgs)
if e.KeyValue = 46 then
e.Handles = true
end if

Only translated nothing added or deleted
:-)

Cor
private void richTextBox1_KeyDown(object sender,
System.Windows.Forms.KeyEventArgs e) {

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

}
--
W.G. Ryan, MVP

www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com
"juststarter" <ju*********@discussions.microsoft.com> wrote in message
news:CC**********************************@microsof t.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**************@tk2msftngp13.phx.gbl...
Private sub richTextbox1_Keydown (byval sender as object, byval e as
System.Windows.Forms.KeyEventArgs)
if e.KeyValue = 46 then
e.Handles = true
end if

Only translated nothing added or deleted
:-)

Cor
private void richTextBox1_KeyDown(object sender,
System.Windows.Forms.KeyEventArgs e) {

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

}
--
W.G. Ryan, MVP

www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com
"juststarter" <ju*********@discussions.microsoft.com> wrote in message
news:CC**********************************@microsof t.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**************@tk2msftngp13.phx.gbl...
Private sub richTextbox1_Keydown (byval sender as object, byval e as
System.Windows.Forms.KeyEventArgs)
if e.KeyValue = 46 then
e.Handles = true
end if

Only translated nothing added or deleted
:-)

Cor
private void richTextBox1_KeyDown(object sender,
System.Windows.Forms.KeyEventArgs e) {

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

}
--
W.G. Ryan, MVP

www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com
"juststarter" <ju*********@discussions.microsoft.com> wrote in message
news:CC**********************************@microsof t.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
5891
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...
1
1687
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...
4
3118
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...
1
2918
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
1921
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...
1
2696
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...
0
1490
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,...
3
1931
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...
3
11609
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...
3
3903
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 ,...
0
7207
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,...
0
7095
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...
0
7361
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...
1
7015
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...
0
7470
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...
0
4693
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...
0
3183
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...
0
3173
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
749
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.