Hello all,
I am new to .NET and a i am moving from Delphi (finally!) to C#.
Now, i am trying to develop custom TextBox for numeric input. I have done it
almost, now i need to prevent paste so someone couldnt paste letters into
numeric text box. How this can be done in C#? In Delphi there was method to
implement methods wiht message code WM_PASTE, and within that method i could
control the contents of the pasted text.
Thanks.
Radovan 3 15241
To intercept messages in textbox control, derive a class from TexBox and
implement
protected override void WndProc(ref Message m)
{
case 0x302: //WM_PASTE
{
}
base.WndProc(ref m)
}
--
Shak
(Houston)
"Radovan Radic" <ra****@eunet.yu> wrote in message
news:ui**************@TK2MSFTNGP09.phx.gbl... Hello all,
I am new to .NET and a i am moving from Delphi (finally!) to C#. Now, i am trying to develop custom TextBox for numeric input. I have done
it almost, now i need to prevent paste so someone couldnt paste letters into numeric text box. How this can be done in C#? In Delphi there was method
to implement methods wiht message code WM_PASTE, and within that method i
could control the contents of the pasted text.
Thanks. Radovan
To intercept messages in textbox control, derive a class from TexBox and
implement
protected override void WndProc(ref Message m)
{
switch(m.Msg)
{
case 0x302: //WM_PASTE
{
}
default:
base.WndProc(ref m)
}
}
--
Shak
(Houston)
"Radovan Radic" <ra****@eunet.yu> wrote in message
news:ui**************@TK2MSFTNGP09.phx.gbl... Hello all,
I am new to .NET and a i am moving from Delphi (finally!) to C#. Now, i am trying to develop custom TextBox for numeric input. I have done
it almost, now i need to prevent paste so someone couldnt paste letters into numeric text box. How this can be done in C#? In Delphi there was method
to implement methods wiht message code WM_PASTE, and within that method i
could control the contents of the pasted text.
Thanks. Radovan
Thanx a lot Shakir, i appreciate your help.
Radovan
"Shakir Hussain" <sh**@fakedomain.com> wrote in message
news:uC**************@TK2MSFTNGP11.phx.gbl... To intercept messages in textbox control, derive a class from TexBox and implement
protected override void WndProc(ref Message m) { switch(m.Msg) { case 0x302: //WM_PASTE { } default: base.WndProc(ref m) } }
-- Shak (Houston)
"Radovan Radic" <ra****@eunet.yu> wrote in message news:ui**************@TK2MSFTNGP09.phx.gbl... Hello all,
I am new to .NET and a i am moving from Delphi (finally!) to C#. Now, i am trying to develop custom TextBox for numeric input. I have
done it almost, now i need to prevent paste so someone couldnt paste letters
into numeric text box. How this can be done in C#? In Delphi there was method to implement methods wiht message code WM_PASTE, and within that method i could control the contents of the pasted text.
Thanks. Radovan
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: VitoriaTang |
last post by:
I want to know how to capture the paste message.
I tried to capture the WM_PASTE, but it seems as the
richtextbox doedn't send this message.
But in fact, I can find the textbox will send paste...
|
by: Dan K. |
last post by:
Hi Folks,
Problem is, that on one of my controls the DEL key wont work in
textboxes. i have different controls of this kind in my app and this
is the only one the DEL Key wont do his job....
|
by: Legendary Pansy |
last post by:
I was checking out the 101 C# Samples, specifically Windows Forms - Use the Clipboard. I took a look at the code for a while, and I understand what the program is doing with the cut, copy, pasting...
|
by: John |
last post by:
Hi
How can I implement cut or copy or paste in code?
Thanks
Regards
|
by: Stefan De Schepper |
last post by:
Dear NG,
I created a gridlike usercontrol. When clicking on a cell a textbox (or
other control, depending on the cell's editortype) is shown. When some other
control gets the focus, the textbox...
|
by: Steve |
last post by:
I'm trying to code cut, copy, and paste in vb 2005 so that when the user
clicks on a toolbar button, the cut/copy/paste will work with whatever
textbox the cursor is current located in (I have...
|
by: Simon Verona |
last post by:
Sorry for the repost, but this group seems to be more "active" than the
group that I posted my question, and it's probably as valid here as there!
I have a usercontrol, which contains a textbox...
|
by: John |
last post by:
Hi
In a winform app I need to provide a menu with Cut, Copy and Paste options.,
What code do I use to accomplish cut, copy and paste features for fields on
a winfrom?
Thanks
Regards
|
by: jh |
last post by:
I'd like to copy/paste into a listbox during runtime. I can do this for a
textbox but can't figure out how to accomplish this for a listbox. Any
help? Thanks.
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
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,...
|
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...
|
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,...
|
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...
|
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...
| |