473,804 Members | 3,526 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Is there any way to disable some of the menu items of default textbox context menu?

26 New Member
I am developing windows application using C# 3.0 and .NET framework 3.5. My application has many forms and on them many text boxes and uses XML as back end.

I am using Windows XP SP3 and have installed east Asian languages. After installing east Asian languages, i am getting three extra menu items in the default context menu (cut, copy, paste context menu) for text box. These three options are : "Right to left Reading order", "Show Unicode control characters" and "Insert Unicode control characters". The third option opens to right and displays Unicode control characters that can be added to text box (http://www.microsoft.com/resources/d....mspx?mfr=true).

Last two options of these Unicode control characters are "Record Separator (Block separator)" and "Unit Separator (Segment separator)" which are invalid XML characters and so cannot be serialized to XML (I am using XMLSerializer).

Now one way to handle this is to use validation, but I have many text boxes and some grid views so is there any other way to avoid these characters like disabling these two options or something like that?

Regards,
Abhishek
Apr 28 '10 #1
8 5341
Plater
7,872 Recognized Expert Expert
Well you could force your application to use a set language/locale, that *might* keep those items from happening.
Apr 28 '10 #2
kulabhishek
26 New Member
@Plater
Thanks for your reply.

Actually my application supports localization and it will be localized to some of the Asian languages, so cannot use a set language/locale.

Regards
Abhishek
Apr 29 '10 #3
Plater
7,872 Recognized Expert Expert
Then why would you want to get rid of the locale options in the context menu?
Apr 29 '10 #4
tlhintoq
3,525 Recognized Expert Specialist
You could create your own context menu and assign it to your textbox. Give it just the options you want.
Apr 29 '10 #5
kulabhishek
26 New Member
@tlhintoq
Whenever i enter these two characters and try to serialize XML, it gives me exception.

Yes creating my own context menu is one option, but i just wanted to know is there any other option.

Thanks
Abhishek
Apr 29 '10 #6
Plater
7,872 Recognized Expert Expert
Hmm, could you get away with searching through the entries and removing the bad characters?
At some point you have to retreive the values from the input boxes right? Just do it there?
Apr 29 '10 #7
kulabhishek
26 New Member
@Plater
Yes I can do that, but as I said there are many forms and text boxes in my application and all the code has already been written. So handling these characters while retrieving values is the last option for me to handle this.

Thanks for your reply.
Apr 30 '10 #8
Plater
7,872 Recognized Expert Expert
Well my point was SOMETHING already grabs the value.
Like: string myval=tbSomeInp ut.Text;
I would assume they are all gabbed at the same time? So add a function:
string myval= ParseStringFunc (tbSomeInput.Te xt);
Then write that function.

I understand wanting a better way, but in the time you've been looking for the answer, you could have long since had it all implemented
May 3 '10 #9

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

Similar topics

29
9804
by: lori3laz | last post by:
How do you disable the right click>view source option on web pages so people can't view your coding and copy it? What's the html I need to include in my website to utilize this feature? Thank you.
1
1195
by: HABJAN ®iga | last post by:
Hello, i was wondering if there is a way to 'override' default context menu: if i press RightMouseButton on textbox i get dcm {cut;copy;past,...} is there a way to add a menu to dcm? i want to add menu called 'CALL' : it's enabled or disabled depending on selected text.
5
2286
by: lgbjr | last post by:
Hello All, I have several Pictureboxes (linked to an AccessDB) on a VB.NET form. I would like to use a context menu to allow the user to open the picture in their default picture viewer or editor. I'd like to use the same default viewer/editor and open with... choices that are present on the users computer. Does anyone know how I can find this information programatically, so my picturebox context menu uses the same settings as the...
1
2724
by: Chris Murphy via DotNetMonster.com | last post by:
Hi all, I'm just wondering if any one can help me with this development issue I'm having. I've created a customized treeview control to handle the particular tasks to which I'll be using it. Within the control I'm dynamically creating a context menu and assigning it to the ContextMenu property of the control -- think of this like the default context menu for standard textboxes -- the context menu has a number of menu items that reflect...
1
14336
by: Preeti | last post by:
Hi all I am a fresher and have been given a requirement in VB.net I have to make an application in VB.net which will run as a system tray icon and will add one or two items in the default windows right clink context menu. on clicking on that menu item the application should write a signature on the current cursor position
1
6806
by: Robert Mago | last post by:
I have a scenario where a user can click on a textbox, a context menu is displayed and he can select a particular text from the list. Then, that text will be appended to the textbox. Thus i have several textboxes, that share the same context menu since the text is common, and all the items in the context menu share the same click event since they perform the same action, its just the text to append that varies. My query is from that...
1
5257
by: =?Utf-8?B?QW5kcmV3?= | last post by:
Hi, friends, I am using C#.net 2005 to create a windows application. It has menu items, such as File, etc. Under File, there are more menu items, such as New Files, Working Files, etc. Under New Files/Working Files, there are more sub menu items, respectively. All those menu items are enabled at beginning.
8
3732
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I disable the right mouse button? ----------------------------------------------------------------------- The oncontextmenu intrinsic event is the only safe and reliable method. Of the other approaches often presented, most depend on an alert box interrupting the process and rarely work. Note that oncontextmenu is a non-standard event and is not...
5
22951
by: neehakale | last post by:
language using: C#. platform for program: WINDOWS FORM I wnt to disable the right click for text boxes.And also want to diable the context menu. I have already disable the Minimize and maximizsed buttons from the form properties and set the form border style to fix dialog but still on right click of mouse, the context menu for close and move is cming.
1
5601
by: =?Utf-8?B?anAybXNmdA==?= | last post by:
I've got one Context Menu named mi_EasterEggs with three (3) menu items: * mi_FontArial * mi_FontCourier * mi_RawData All menu items have their Visible properties set to False when the form loads. This context menu is included in one (1) ListView control and one (1) TextBox control.
0
9708
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10589
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...
0
10340
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
10327
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,...
1
7625
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
6857
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
5527
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...
1
4302
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3828
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.