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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T03:54:40+00:00 2026-06-11T03:54:40+00:00

Ok, the following codes shows how I am enterting a value into a textbox,

  • 0

Ok, the following codes shows how I am enterting a value into a textbox, adding that value to the listbox, updating a picturebox next to it and blanking out the textbox so the user can add additional values to the listbox.

    ListBox1.Items.Add(TextBoxTicketID.Text)

    If CStr(ListBox1.Items(0)) = TextBoxTicketID.Text Then
        PictureBoxStatus1.Image = My.Resources.Orange_Information
    End If

    TextBoxTicketID.Text = ""

I have another process not shown here that will create a PDF based on the value that was entered into the listbox.

I’m having trouble with a loop to check a specific directory if the PDF exists or not. When the PDF exists, I’ll change the picturebox to another image.

Here is the loop that I was using, but the issue I ran into was that the user couldn’t enter a second value unless the first value was present.

Loop Until My.Computer.FileSystem.FileExists("c:\Temp\" + ListBox1.Items(0) + ".pdf")
PictureBoxStatus1.Image = My.Resources.Green_Checkmark

So in theory, I need to be able to enter X amount of values into the listbox and keep checking to see if the file exists and if it does, change those images that needed.

EDIT

Here’s what I ended up doing…seems to be working fine though…

    ListBox1.Items.Add(TextBoxTicketID.Text)

    If CStr(ListBox1.Items(0)) = TextBoxTicketID.Text Then
        PictureBoxStatus1.Image = My.Resources.Orange_Information
    End If

    TextBoxTicketID.Text = ""
    Call CheckFiles()

Added a public sub

    Public Sub CheckSpooling()
    Dim Watcher As New FileSystemWatcher()
    Watcher.Path = "C:\Temp\"
    Watcher.Filter = ListBox1.Items(0) + ".pdf"

    AddHandler Watcher.Created, AddressOf OnChanged

    Watcher.EnableRaisingEvents = True
    End Sub

Then the sub to run whatever is needed if the file was added. I used a msgbox for testing.

    Private Shared Sub OnChanged(source As Object, e As FileSystemEventArgs)
    ' Specify what is done when a file is created.
    MsgBox("File has been created!")
    End Sub
  • 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-11T03:54:41+00:00Added an answer on June 11, 2026 at 3:54 am

    Check out the FileSystemWatcher

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The following code shows a button that allows you to select a file (should
In the following code every time button is clicked the alter shows the value
The following code shows what I would like to do; that is, I would
The following code shows me that cacheasbitmap is turning on and off like it
i use these following codes to get cell's value in datagridview. these codes show
Consider the following sample codes which shows multilevel inheritance: Case1 : Here the class
The following code shows 1 view, 1 partial view, and 1 controller . The
The following code shows what I currently have. It is an adapter for circular
Currently, the following code shows a blank line if Address2 (which comes from the
Consider the following code which shows compile time error : #include <stdio.h> int main(int

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.