473,508 Members | 2,128 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Textbox events

I need to validate the text in the textbox as the user enters them. If there
is a wildcard character the user's entry should be cleared. How do I do
this? I am having a problem in setting the keychar/keycode to vbkeyclear as
they are readonly. When I used VB6, I set keyascii to vbkeyclear. Can some
one help me on this one in VB.Net?
Nov 21 '05 #1
2 1501
Hi,

e.Handled = true in the keypress event will prevent the key from
showing up. Hope this helps.

Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress

e.Handled = (e.KeyChar = "*")

End Sub

Ken

-----------------------------------

"VB User" <VB****@discussions.microsoft.com> wrote in message
news:CB**********************************@microsof t.com...
I need to validate the text in the textbox as the user enters them. If
there
is a wildcard character the user's entry should be cleared. How do I do
this? I am having a problem in setting the keychar/keycode to vbkeyclear as
they are readonly. When I used VB6, I set keyascii to vbkeyclear. Can some
one help me on this one in VB.Net?
Nov 21 '05 #2
Thanks for the suggestion, it helps.
"Ken Tucker [MVP]" wrote:
Hi,

e.Handled = true in the keypress event will prevent the key from
showing up. Hope this helps.

Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress

e.Handled = (e.KeyChar = "*")

End Sub

Ken

-----------------------------------

"VB User" <VB****@discussions.microsoft.com> wrote in message
news:CB**********************************@microsof t.com...
I need to validate the text in the textbox as the user enters them. If
there
is a wildcard character the user's entry should be cleared. How do I do
this? I am having a problem in setting the keychar/keycode to vbkeyclear as
they are readonly. When I used VB6, I set keyascii to vbkeyclear. Can some
one help me on this one in VB.Net?

Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2103
by: Jonas L | last post by:
Hi, I need to create a textbox which acts as a normal textbox but with the following extra requirements: 1) In-focus color, when the textbox gets focus the backcolor property of the textbox...
7
5759
by: Seash | last post by:
Hi friends , here is the sample code private void txtbox_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e) { if(e.KeyChar == 13) //enter { txtbox2.Focus(); }
28
4293
by: kfrost | last post by:
I know this is probably simple but I have a C# form and the class for the form is called sbaSynch. I have a textbox name txtServerName. I'm creating a class to manipulate XML functions so I...
11
4514
by: Keith | last post by:
I apologize for those of you who think I'm posting on the same topic. It is not that I don't appreciate all of your comments - and I'm definitely reading them all - but I think I have a differing...
10
3084
by: Dennis | last post by:
I have a simple form with one button and one text box. In the Form, I create an array list to track the events by adding a descriptive string item to the arraylist in each event. I first Click on...
8
30393
by: John | last post by:
Hi, I am developing an application using VB.Net and hope that the textbox can process features which are similar to auto-complete features in Window. For example, when user types "ap" in a...
2
8019
by: Jonathan Allen | last post by:
In dialog boxes in Windows, the text in TextBox is automatically selected if you tab into the TextBox , but not when you select the TextBox using the mouse. What is the preferred way to support...
8
5062
by: Filipe Marcelino | last post by:
Hi, I'm trying to create a textbox inheriting from the standard textbox. I would like to: 1. repaint the textbox border; 2. define a color for that border; Till now I made this:
5
7438
by: =?Utf-8?B?QmVuIFIu?= | last post by:
Hi, In a .NET 2.0 winforms application, I've got a textbox that, when updated, uses the validated event to cascade the change to another textbox (along with another value). This works well if...
1
6293
by: JFKJr | last post by:
Hello everyone, the following Access VBA code opens an excel file and creates textboxes in a given range of cells dynamically. The code attaches "MouseUP" and "Exit" events to the textboxes (using...
0
7225
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
7326
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,...
1
7046
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
7498
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
5627
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,...
1
5053
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...
0
1557
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 ...
1
766
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
418
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...

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.