Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8901809
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T01:27:13+00:00 2026-06-15T01:27:13+00:00

In a simple program that I am working on in VB.NET, I have created

  • 0

In a simple program that I am working on in VB.NET, I have created several ComboBoxes and TextBoxes dynamically.

For example, like:

    Dim i As Integer
    For i = 0 To 11
        Dim NewTxt As New TextBox()
        Me.Controls.Add(NewTxt)
        NewTxt.Name = "txtNoteInput" & i
    Next

I would like to restrict the user from entering certain keyboard characters into these TextBoxes. I have done this in the past for individual TextBoxes created visually by using “… Handles ExampleTextBox.KeyPress” (Something like described here: http://msdn.microsoft.com/en-us/library/ms171538.aspx ).

I am looking for help on how to do this: (1) for dynamically created TextBoxes, and (2) with one (or few) blocks of code which apply to many TextBoxes.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T01:27:14+00:00Added an answer on June 15, 2026 at 1:27 am

    Using this as a reference, something along the lines of:

    Dim i As Integer
    For i = 0 To 11
        Dim NewTxt As New TextBox()
        Me.Controls.Add(NewTxt)
        NewTxt.Name = "txtNoteInput" & i
        ' Add this line below:
        AddHandler NewTxt.TextChanged, AddressOf Text_Changed
    Next
    

    With:

    Private Sub Text_Changed(ByVal eventSender As System.Object, _
                             ByVal eventArgs As System.EventArgs)
        Dim txt As String = eventSender.Text
        ' Do your regular filtering here as you would normally
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple Delphi program that I'm working on, in which I am
I have a simple program that checks webpages for strings, example: Private Sub Button1_Click(ByVal
I am working on a simple FOSS VB.net program that operates mostly in one
i have created a very simple console application in vb.net that emails me some
Version used: Delphi 7. I'm working on a program that does a simple for
I have this simple program that computes salaries for four different worker types. It's
Say I have simple program that emulates a board game with a number of
I have a simple program that creates a thread, loops twenty times and then
I have a simple program that reads data from a PNG into a 2D
I've my working on using the TPL in C# (.NET 4.0). I have created

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.