How to change a textbox text while the code is running
-
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?
-
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?
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...
-
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?
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.
-
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.
Okay but how can I show that it is searching?