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

The Archive Base Latest Questions

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

As part of this assignment for my class, in which I have a listbox

  • 0

As part of this assignment for my class, in which I have a listbox which is connected to a database and it displays the first and last name of the students. I have also created a search feature in which the user types in the first and/or last name they are looking for in a textbox and when they press the “search” button it displays the filtered results appear in the listbox.

The last part of the question asks me to detect when the user clears the textbox, to once again display the original data in the listbox. I have the data in a method called databaseload()and so it is really down to how to I get my program to detect that the listbox is once again empty.

I found a couple of things online, and when I tried them, it didn’t work.

private void searchTextBox_KeyPress(object sender, KeyPressEventArgs e){
  if (e.KeyChar == 8)
  {
    databaseload();
  }
}

and I have also tried KeyDown

I also don’t want it to reload when first backspace is detected. I want it to reload the listbox when the searchTextBox has nothing in it.

Your help is greatly appreciated.

  • 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-13T15:19:11+00:00Added an answer on June 13, 2026 at 3:19 pm

    There is a TextChanged event which seems more appropriate than manually detecting backspaces. The delete key can remove all the text as well, or someone might just highlight all of the text and cut it to the Clipboard.

    Example of using the TextChanged event:

    private void textBox_TextChanged(object sender, EventArgs e)
    {
        if (string.IsNullOrEmpty(((TextBox)sender).Text))
        {
                // reload database
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

(this is indirectly a part of a much larger homework assignment) I have something
I have this part of script from my GAE application which uses webapp2, which
I have this part of the function : $jQ('.product-collateral .product-tabs li').each(function(index){ $jQ(this).attr('id', $jQ(this).find('h3').attr('class')); if(index
This is a class assignment. I had written some codes which I hope someone
I have a declarative base class Entity which defines the column name as polymorphic,
I have a python script that I am writing for a class assignment which
So this is a small part of a large assignment I have, I'm just
For a database assignment I have to model a system for a school. Part
This is my first attempt at java problem I have been given as part
I have this assignment based on coin and card games which is very simplified.

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.