Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. How to change a textbox text while the code is running

How to change a textbox text while the code is running

Scheduled Pinned Locked Moved C#
questionalgorithmshelptutorial
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    User 11883281
    wrote on last edited by
    #1

    Hi there, how can I change the text of my textbox, while the code is running? I will change it when I click on the button "search", and while the programm is searching the text in my textbox should be "searching ..." Can anyone help me please?

    OriginalGriffO B 2 Replies Last reply
    0
    • U User 11883281

      Hi there, how can I change the text of my textbox, while the code is running? I will change it when I click on the button "search", and while the programm is searching the text in my textbox should be "searching ..." Can anyone help me please?

      OriginalGriffO Offline
      OriginalGriffO Offline
      OriginalGriff
      wrote on last edited by
      #2

      Um...

      myTextBox.Text = "Searching...";

      I'm sure that isn't the problem you are having, but I can't work out from that little what problem you want us to solve.

      Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...

      "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
      "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

      1 Reply Last reply
      0
      • U User 11883281

        Hi there, how can I change the text of my textbox, while the code is running? I will change it when I click on the button "search", and while the programm is searching the text in my textbox should be "searching ..." Can anyone help me please?

        B Offline
        B Offline
        BillWoodruff
        wrote on last edited by
        #3

        I think you are asking how you can use the TextBox as both the source of what to search for and, then, while searching, a kind of progress indicator. If this is what you want, I'd argue against that because: 1. if the computer this runs on is not very powerful, you may delay the search. 2. if the computer this runs on is super-powerful, all you may see is a meaningless blur. 3. there is a traditional way of doing this: use either a progress-bar or a status-bar control. There are good resources here on CP for using both progress-bar and/or status-bar with a process (like search) running in its own thread, which is desirable so that the main UI does not become frozen, and the user may have the opportunity to cancel the search, etc.

        «I want to stay as close to the edge as I can without going over. Out on the edge you see all kinds of things you can't see from the center» Kurt Vonnegut.

        U 1 Reply Last reply
        0
        • B BillWoodruff

          I think you are asking how you can use the TextBox as both the source of what to search for and, then, while searching, a kind of progress indicator. If this is what you want, I'd argue against that because: 1. if the computer this runs on is not very powerful, you may delay the search. 2. if the computer this runs on is super-powerful, all you may see is a meaningless blur. 3. there is a traditional way of doing this: use either a progress-bar or a status-bar control. There are good resources here on CP for using both progress-bar and/or status-bar with a process (like search) running in its own thread, which is desirable so that the main UI does not become frozen, and the user may have the opportunity to cancel the search, etc.

          «I want to stay as close to the edge as I can without going over. Out on the edge you see all kinds of things you can't see from the center» Kurt Vonnegut.

          U Offline
          U Offline
          User 11883281
          wrote on last edited by
          #4

          Okay but how can I show that it is searching?

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups