Replacing text in TextBox without the blinking
-
Hey, I'm making a progress screen for an application and when I'm uploading a file he gives the "percentage progress" IN the text (realtime). That's nice and good BUT I always have to do:
txt1.Text = txt1.Text.replace(previousPercentage, newPercentage)
And because there is a lot of text in my textbox it starts to blink when it's refreshed (it doesn't blink when I add something to it). How can I solve this problem? thx! -
Hey, I'm making a progress screen for an application and when I'm uploading a file he gives the "percentage progress" IN the text (realtime). That's nice and good BUT I always have to do:
txt1.Text = txt1.Text.replace(previousPercentage, newPercentage)
And because there is a lot of text in my textbox it starts to blink when it's refreshed (it doesn't blink when I add something to it). How can I solve this problem? thx!How often are you running the replace command ? Perhaps you need to run it on a string and then put that string in your label ?
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
-
Hey, I'm making a progress screen for an application and when I'm uploading a file he gives the "percentage progress" IN the text (realtime). That's nice and good BUT I always have to do:
txt1.Text = txt1.Text.replace(previousPercentage, newPercentage)
And because there is a lot of text in my textbox it starts to blink when it's refreshed (it doesn't blink when I add something to it). How can I solve this problem? thx!Wrap the update up with a
BeginUpdate()
,EndUpdate()
block.Deja View - the feeling that you've seen this post before.
-
Wrap the update up with a
BeginUpdate()
,EndUpdate()
block.Deja View - the feeling that you've seen this post before.
-
How often are you running the replace command ? Perhaps you need to run it on a string and then put that string in your label ?
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
-
Not the textbox, but the whole update of your control.
Deja View - the feeling that you've seen this post before.
-
Not the textbox, but the whole update of your control.
Deja View - the feeling that you've seen this post before.
Hey, Do I have to import something for that? And what do you mean with the whole update of your control? Do I have to make a new class, instance, interface? Our just: BeginUpdate(); ApplicationDirector.Instance.removeCharachtersFromProgressScreen(lenghtWrittenString); EndUpdate(); (but that doesn't work) :)
-
Hey, Do I have to import something for that? And what do you mean with the whole update of your control? Do I have to make a new class, instance, interface? Our just: BeginUpdate(); ApplicationDirector.Instance.removeCharachtersFromProgressScreen(lenghtWrittenString); EndUpdate(); (but that doesn't work) :)
Say you have a progressbar control with the text on it (we'll call an instance of it superProgressBar), then you would normally do
superProgressBar.BeginUpdate();superProgressBar.Increment();superProgressBar.EndUpdate();
The Increment method would be responsible for updating the scroll bar and writing the text on it. Also, you might want to consider setting up double buffering. Use the followingthis.SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.DoubleBuffer,true);
Deja View - the feeling that you've seen this post before.