473,657 Members | 2,592 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 9342
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
5913
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 dont want. Does anyone have a good template for this in Visual Basic .Net?
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 GETCHANGES in the update event; but momentarily the users does not see that !! there is something...
4
3122
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
2923
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
1936
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!
1
2708
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 record cannot be deleted. Thanks, Keith
0
1496
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
1939
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
11644
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 how to use it correctly to enable/disable users from pressing shift key to view database windw?,the...
3
3920
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. Even the confirm delete doesn't work. Any way to redefine the function of CTRL + MINUS? Bob
0
8326
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
8743
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8522
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
8622
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
7355
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
6177
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
4173
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...
0
4333
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1736
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.