Results 1 to 9 of 9

Thread: [RESOLVED] Stop TextBox Flickering Form Resize

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2002
    Location
    UK
    Posts
    417

    Resolved [RESOLVED] Stop TextBox Flickering Form Resize

    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.
    When your dreams come true.
    On error resume pulling hair out.

  2. #2
    G&G Moderator chemicalNova's Avatar
    Join Date
    Jun 2002
    Location
    Victoria, Australia
    Posts
    4,246

    Re: Stop TextBox Flickering Form Resize

    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

    Visual Studio 6, Visual Studio.NET 2005, MASM

  3. #3

  4. #4
    G&G Moderator chemicalNova's Avatar
    Join Date
    Jun 2002
    Location
    Victoria, Australia
    Posts
    4,246

    Re: Stop TextBox Flickering Form Resize

    Ah. In that case the LockWindowUpdate API wouldn't work. Or it would look weird. I might give it a shot..

    chem

    Visual Studio 6, Visual Studio.NET 2005, MASM

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2002
    Location
    UK
    Posts
    417

    Re: Stop TextBox Flickering Form Resize

    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 ?
    Last edited by dreamvb; Oct 14th, 2005 at 09:41 PM.
    When your dreams come true.
    On error resume pulling hair out.

  6. #6
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: Stop TextBox Flickering Form Resize

    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.

  7. #7
    G&G Moderator chemicalNova's Avatar
    Join Date
    Jun 2002
    Location
    Victoria, Australia
    Posts
    4,246

    Re: Stop TextBox Flickering Form Resize

    This worked for me, although the forms border goes a little weird because of the Sleep call:
    VB Code:
    1. Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
    2.  
    3.  
    4. Private Sub Form_Resize()
    5. Text1.Height = Me.Height - 500
    6. Text1.Width = Me.Width - 500
    7. DoEvents
    8. Sleep (25)
    9. End Sub
    ..might help you a bit.

    chem

    Visual Studio 6, Visual Studio.NET 2005, MASM

  8. #8

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2002
    Location
    UK
    Posts
    417

    Re: Stop TextBox Flickering Form Resize

    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.
    When your dreams come true.
    On error resume pulling hair out.

  9. #9

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width