Solved

Stopping User Input On Numeric Up/Down

Posted on 2006-06-26
2
215 Views
Last Modified: 2008-03-04
Hi,

Is there any way to stop the user entering data into numeric up down fields in VS 2005?

Thanks.
0
Comment
Question by:sterrius
  • 2
2 Comments
 
LVL 16

Expert Comment

by:Swapnil Piparia
ID: 16982686
Hi sterrius,
just write keypress event as under

    Private Sub NumericUpDown1_KeyPress(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles NumericUpDown1.KeyPress
        Exit Sub
    End Sub

Regards,
NetSwap
0
 
LVL 16

Accepted Solution

by:
Swapnil Piparia earned 125 total points
ID: 16982705
sterrius,
sorry but replace above code as below

Private Sub NumericUpDown1_KeyPress(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles NumericUpDown1.KeyPress
        e.KeyChar = ""
    End Sub
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Convert datetime to time string 10 28
location of a form 2 25
Visual studio 2015 1 21
How to share My.Settings in multiple application instances ? 7 28
This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question