المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Context menu for a text box.



C# Programming
09-18-2009, 01:51 AM
Hi,

I have a scenario where I'm validating the data in a text box for special character.

The user can enter the data through keyboard, Copy & paste data using Ctrl+C and Ctrl+V from keyboard, or right click and paste using mouse.

I have to validate the data before it is pasted to the textbox. I'm validating the data for first two scenarios, i.e., validating while user enteres the data, or pasting the data using Ctrl+C and Ctrl+V from keyboard.

I'm not able to find any events which triggers contextmenu_paste_click event.

I'm not allowed to create a context menu for the textbox, that is I have to use the default context menu and I cannot create a new class which inherits the textBox class.

How can I implement this?

Any suggestion is appreciated.

Thank you.