Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Code is VB.Net, Trying to restrict users from entering anything accept numbers into the text boxes using a CASE statement, but I keep getting System.EventArgs

Code is VB.Net, Trying to restrict users from entering anything accept numbers into the text boxes using a CASE statement, but I keep getting System.EventArgs errors.

My Code:

Protected Sub ValueBox1_TextChanged(sender As Object, e As EventArgs) Handles ValueBox1.TextChanged Select Case e.KeyChar Case "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", vbBack e.Handled = False Case Else e.Handled = True End Select End Sub

Errors = 'KeyChar' and 'Handled' are not members of 'System.EventArgs'

I have tried changing it to a KeyPress event

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

but then the message changes to "KeyPress" cannot be found.

How can I restrict users from entering anything accet numbers??

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Pro PowerShell For Database Developers

Authors: Bryan P Cafferky

1st Edition

1484205413, 9781484205419

More Books

Students also viewed these Databases questions

Question

What is the basis for Security Concerns in Cloud Computing?

Answered: 1 week ago

Question

Describe the three main Cloud Computing Environments.

Answered: 1 week ago