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 8703013
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T02:47:10+00:00 2026-06-13T02:47:10+00:00

I have a VB.NET form and the user would select from 40 different values.

  • 0

I have a VB.NET form and the user would select from 40 different values.
I want instead of a dropbox with all 40 values to use a textbox that validates if the stirng given by user is one valuo out off those 40 words.

so for example I need the user writes something and validate the string is one of those 40 reserved words like “urgent”,”post”… maybe these words stored in an array, and then compared what user wrote against that?

TextBox1.Text.Contains("urgent")
TextBox1.Text.Contains("post")
TextBox1.Text.Contains("standard")
TextBox1.Text.Contains("stay")

Maybe a method

Public Function Contains(ByVal value As String) As Boolean   
    Return (   TextBox1.Text(value, ...) >= 0)
End Function 

What would be the best way to do this?

  • 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-13T02:47:11+00:00Added an answer on June 13, 2026 at 2:47 am

    You can create a List(of String) of your Reserved Words use the Contains method to check if what was typed was one of them using your Contains function something like this. I am not sure how large the Text you are going to be parsing so I am splitting it into individual words.

    Public Class Form1
        Dim reservedWords As List(Of String) = New List(Of String)({"urgent", "post", "standard", "stay"})
    
        Private Sub TextBox1_TextChanged(sender As System.Object, e As System.EventArgs) Handles TextBox1.TextChanged
            Dim text As String = CType(sender, TextBox).Text
            If ContainsReservedWord(text) Then Beep()
        End Sub
    
        Public Function ContainsReservedWord(value As String) As Boolean
            Dim x As Integer
            Dim stringSplit As String() = value.Split
            If stringSplit.Count > 0 Then
                For x = 0 To stringSplit.Count - 1
                    If reservedWords.Contains(LCase(stringSplit(x))) Then  Return True
                Next
            End If
            Return False
        End Function
    
    End Class
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a form on all my pages that allows the user to select
I have this website (C#/ASP.NET) with a form where the user can register for
I have an asp.net form that contains some html, 2 controls a calendar from
I have a VB.NET form with a red background and white text. I want
i have an asp.net form and an asp:textbox. i have a problem when the
I have a vb.net 2010 form with 22 data bound controls from two tables
I have a typical ADO.NET EF-driven form that allows the user to input a
I have a simple .net windows form which inserts user input into sql database.
If I have created an order form, and want to allow the user to
Basically what i have is a vb.net form that when a user clicks the

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.