Hi
can anyone suguest any idea or may have some example code on how I can stop Flickering of a textbox when resizeing a form.
Any help whould be greatfull.
Printable View
Hi
can anyone suguest any idea or may have some example code on how I can stop Flickering of a textbox when resizeing a form.
Any help whould be greatfull.
It flickers? Mine are flicker free when I resize the form.
The only thing I can suggest -- not having this problem myself -- would be to either set its enabled property to false while you're resizing, or use the LockWindowUpdate() API. I'm not sure if the LockWindowUpdate would be what you're looking for, but give it a shot.
chem
If you have a multiline textbox which changes size as the form changes size and you make the form bigger by dragging the corner then the text will flicker.
Ah. In that case the LockWindowUpdate API wouldn't work. Or it would look weird. I might give it a shot..
chem
hi I have tryed setting the enabled state of the textbox to false but it makes no different. I also had a look at LockWindowUpdate but that locks the whole thing from redrawing.
Funny think tho it does not happen on the RichText Ocx. so I am guessing there must be something you can do for Text Boxes. I whould have used the RichEdit OCX but. I do not fancy haveing to include that OCX just to stop the flickering.
Umm any other ideas ?
Try a DoEvents at the end of your Form_Resize code. It seems to eliminate the flickering. The text still is broken into a varying number of lines but that's to be expected.
This worked for me, although the forms border goes a little weird because of the Sleep call:
..might help you a bit.VB Code:
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long) Private Sub Form_Resize() Text1.Height = Me.Height - 500 Text1.Width = Me.Width - 500 DoEvents Sleep (25) End Sub
chem
tryed it with DoEvents slows it down a little . but it;s still very noticeable with lots of lines of text.
O well I think we hit a dead end with this one. I think I may look at the RichText OCX after all. o well thanks for all the help anyway. very greatfull.
I think you'll find that the RTB acts pretty much the same.