Listbox flickers on form resize

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • nirdeshonline@gmail.com

    #1

    Listbox flickers on form resize

    Hi,
    I have added a simple listbox in windows form under c# 2.0. It contains
    a collection of approx 10 strings as list items. Now when i resize the
    form whole listbox flickers.

    Please tell me any feasible solution, i need to use a checked listbox
    which also has same flickering problem on resize.

    Thanks & Regards

    Nirdesh Dabas
    nirdeshonline@g mail.com

  • Stoitcho Goutsev \(100\)

    #2
    Re: Listbox flickers on form resize

    Nirdesh,

    When does the control flicker. I created a test application with listbox
    containing 100 strings and I don't see any flickering. Either I don't
    reproduce your case correctly or you have something esle going on in your
    application. Can you post simple, but compilable sample that demonstrates
    your problem.


    --
    Stoitcho Goutsev (100)

    <nirdeshonline@ gmail.comwrote in message
    news:1162910236 .400405.257850@ e3g2000cwe.goog legroups.com...
    Hi,
    I have added a simple listbox in windows form under c# 2.0. It contains
    a collection of approx 10 strings as list items. Now when i resize the
    form whole listbox flickers.
    >
    Please tell me any feasible solution, i need to use a checked listbox
    which also has same flickering problem on resize.
    >
    Thanks & Regards
    >
    Nirdesh Dabas
    nirdeshonline@g mail.com
    >

    Comment

    • nirdeshonline@gmail.com

      #3
      Re: Listbox flickers on form resize

      hi,
      You might have kept a listbox on a form. Thats fine. Please run the
      application and try to resize the form. When you resize the form all
      the contents of the listbox reloads and gives ample amount of
      flickering.
      Is there any solution to this problem.
      Thanks & Regards
      Nirdesh

      Stoitcho Goutsev (100) wrote:
      Nirdesh,
      >
      When does the control flicker. I created a test application with listbox
      containing 100 strings and I don't see any flickering. Either I don't
      reproduce your case correctly or you have something esle going on in your
      application. Can you post simple, but compilable sample that demonstrates
      your problem.
      >
      >
      --
      Stoitcho Goutsev (100)
      >
      <nirdeshonline@ gmail.comwrote in message
      news:1162910236 .400405.257850@ e3g2000cwe.goog legroups.com...
      Hi,
      I have added a simple listbox in windows form under c# 2.0. It contains
      a collection of approx 10 strings as list items. Now when i resize the
      form whole listbox flickers.

      Please tell me any feasible solution, i need to use a checked listbox
      which also has same flickering problem on resize.

      Thanks & Regards

      Nirdesh Dabas
      nirdeshonline@g mail.com

      Comment

      • Roman Wagner

        #4
        Re: Listbox flickers on form resize

        Hi,

        you may register to the form events ResizeBegin and -End. In
        ResizeBegin event handler
        call form.SuspendLay out and in ResizeEnd event handler call
        form.ResumeLayo ut.
        This is not tested but maybe it helps you.

        Comment

        • nirdeshonline@gmail.com

          #5
          Re: Listbox flickers on form resize

          PROBLEM STILL EXISTS
          I can use

          [DllImport("user 32.dll")]

          public static extern bool LockWindowUpdat e(IntPtr hWndLock);

          to lock the update at ResizeBegin and ResizeEnd but it stops the
          redrawing of control and if i resize the form to minimum and stretch it
          back i will find that the control i not painted and gives unwanted
          image. I found similar flickering issue in listbox & CheckedListBox.

          Even BeginUpdate and EndUpdate did not worked as it shows empty list
          while resizing.

          And your stated form events ResizeBegin and -End form.SuspendLay out
          using form.ResumeLayo ut do not work for listbox and checkedlistbox. :(

          Roman Wagner wrote:
          Hi,
          >
          you may register to the form events ResizeBegin and -End. In
          ResizeBegin event handler
          call form.SuspendLay out and in ResizeEnd event handler call
          form.ResumeLayo ut.
          This is not tested but maybe it helps you.

          Comment

          • Stoitcho Goutsev \(100\)

            #6
            Re: Listbox flickers on form resize

            What I did I anchored the control so it resizes when the form resizes. I
            resized the form and as a matter of fact I can see some hardly noticable
            flickering on the elements on the top, but nothing so drastic, but yes there
            is some filickering. I find it strange that on my test only the first
            element in the lisbox flickers - not the first visible, but the first in the
            list. There are some thinks that looks like reduce the flicker, but doesn't
            get rid of it completely:
            1. Set IntegralHeight to *false* it looks like there is some problem and the
            control height changes without visible reason as the list box resizes.
            2. Try to double buffer the control. I'd expect this to remove the
            flickering, but it looks like it only reduces it a bit. To do that you need
            to inherit from the control and in the constructor to set DoubleBuffered
            protected property to *true*.

            If this doesn't give you good result trye using ListView. I haven't tried,
            but as a more complex control it may behave better.


            --
            HTH
            Stoitcho Goutsev (100)

            This flickering can be removed if I inherit from the listbox and make it
            double buffered.
            <nirdeshonline@ gmail.comwrote in message
            news:1162959996 .476212.296140@ b28g2000cwb.goo glegroups.com.. .
            hi,
            You might have kept a listbox on a form. Thats fine. Please run the
            application and try to resize the form. When you resize the form all
            the contents of the listbox reloads and gives ample amount of
            flickering.
            Is there any solution to this problem.
            Thanks & Regards
            Nirdesh
            >
            Stoitcho Goutsev (100) wrote:
            >Nirdesh,
            >>
            >When does the control flicker. I created a test application with listbox
            >containing 100 strings and I don't see any flickering. Either I don't
            >reproduce your case correctly or you have something esle going on in your
            >application. Can you post simple, but compilable sample that demonstrates
            >your problem.
            >>
            >>
            >--
            >Stoitcho Goutsev (100)
            >>
            ><nirdeshonline @gmail.comwrote in message
            >news:116291023 6.400405.257850 @e3g2000cwe.goo glegroups.com.. .
            Hi,
            I have added a simple listbox in windows form under c# 2.0. It contains
            a collection of approx 10 strings as list items. Now when i resize the
            form whole listbox flickers.
            >
            Please tell me any feasible solution, i need to use a checked listbox
            which also has same flickering problem on resize.
            >
            Thanks & Regards
            >
            Nirdesh Dabas
            nirdeshonline@g mail.com
            >
            >

            Comment

            • nirdeshonline@gmail.com

              #7
              Re: Listbox flickers on form resize

              Hi thanks for the reply,
              The problem i stated is specific to tabcontrol. Even i noticed it late
              .. when i dock fill
              tabcontrol on a form and put a listbox in docked tabcontrol. THEN AT
              RESIZE of the
              form, listbox as well as the tabcontrol flickers badly.
              Please tell any possible solution

              Stoitcho Goutsev (100) wrote:
              What I did I anchored the control so it resizes when the form resizes. I
              resized the form and as a matter of fact I can see some hardly noticable
              flickering on the elements on the top, but nothing so drastic, but yes there
              is some filickering. I find it strange that on my test only the first
              element in the lisbox flickers - not the first visible, but the first in the
              list. There are some thinks that looks like reduce the flicker, but doesn't
              get rid of it completely:
              1. Set IntegralHeight to *false* it looks like there is some problem and the
              control height changes without visible reason as the list box resizes.
              2. Try to double buffer the control. I'd expect this to remove the
              flickering, but it looks like it only reduces it a bit. To do that you need
              to inherit from the control and in the constructor to set DoubleBuffered
              protected property to *true*.
              >
              If this doesn't give you good result trye using ListView. I haven't tried,
              but as a more complex control it may behave better.
              >
              >
              --
              HTH
              Stoitcho Goutsev (100)
              >
              This flickering can be removed if I inherit from the listbox and make it
              double buffered.
              <nirdeshonline@ gmail.comwrote in message
              news:1162959996 .476212.296140@ b28g2000cwb.goo glegroups.com.. .
              hi,
              You might have kept a listbox on a form. Thats fine. Please run the
              application and try to resize the form. When you resize the form all
              the contents of the listbox reloads and gives ample amount of
              flickering.
              Is there any solution to this problem.
              Thanks & Regards
              Nirdesh

              Stoitcho Goutsev (100) wrote:
              Nirdesh,
              >
              When does the control flicker. I created a test application with listbox
              containing 100 strings and I don't see any flickering. Either I don't
              reproduce your case correctly or you have something esle going on in your
              application. Can you post simple, but compilable sample that demonstrates
              your problem.
              >
              >
              --
              Stoitcho Goutsev (100)
              >
              <nirdeshonline@ gmail.comwrote in message
              news:1162910236 .400405.257850@ e3g2000cwe.goog legroups.com...
              Hi,
              I have added a simple listbox in windows form under c# 2.0. It contains
              a collection of approx 10 strings as list items. Now when i resize the
              form whole listbox flickers.

              Please tell me any feasible solution, i need to use a checked listbox
              which also has same flickering problem on resize.

              Thanks & Regards

              Nirdesh Dabas
              nirdeshonline@g mail.com

              Comment

              • nirdeshonline@gmail.com

                #8
                Re: Listbox flickers on form resize


                Stoitcho Goutsev (100) wrote:
                What I did I anchored the control so it resizes when the form resizes. I
                resized the form and as a matter of fact I can see some hardly noticable
                flickering on the elements on the top, but nothing so drastic, but yes there
                is some filickering. I find it strange that on my test only the first
                element in the lisbox flickers - not the first visible, but the first in the
                list. There are some thinks that looks like reduce the flicker, but doesn't
                get rid of it completely:
                1. Set IntegralHeight to *false* it looks like there is some problem and the
                control height changes without visible reason as the list box resizes.
                2. Try to double buffer the control. I'd expect this to remove the
                flickering, but it looks like it only reduces it a bit. To do that you need
                to inherit from the control and in the constructor to set DoubleBuffered
                protected property to *true*.
                >
                If this doesn't give you good result trye using ListView. I haven't tried,
                but as a more complex control it may behave better.
                >
                >
                --
                HTH
                Stoitcho Goutsev (100)
                >
                This flickering can be removed if I inherit from the listbox and make it
                double buffered.
                <nirdeshonline@ gmail.comwrote in message
                news:1162959996 .476212.296140@ b28g2000cwb.goo glegroups.com.. .
                hi,
                You might have kept a listbox on a form. Thats fine. Please run the
                application and try to resize the form. When you resize the form all
                the contents of the listbox reloads and gives ample amount of
                flickering.
                Is there any solution to this problem.
                Thanks & Regards
                Nirdesh

                Stoitcho Goutsev (100) wrote:
                Nirdesh,
                >
                When does the control flicker. I created a test application with listbox
                containing 100 strings and I don't see any flickering. Either I don't
                reproduce your case correctly or you have something esle going on in your
                application. Can you post simple, but compilable sample that demonstrates
                your problem.
                >
                >
                --
                Stoitcho Goutsev (100)
                >
                <nirdeshonline@ gmail.comwrote in message
                news:1162910236 .400405.257850@ e3g2000cwe.goog legroups.com...
                Hi,
                I have added a simple listbox in windows form under c# 2.0. It contains
                a collection of approx 10 strings as list items. Now when i resize the
                form whole listbox flickers.

                Please tell me any feasible solution, i need to use a checked listbox
                which also has same flickering problem on resize.

                Thanks & Regards

                Nirdesh Dabas
                nirdeshonline@g mail.com

                Comment

                • nirdeshonline@gmail.com

                  #9
                  Docked Tabcontrol flickers on form resize

                  The problem i stated is specific to tabcontrol. Sorry i stated it
                  inappropriately earlier . when i dock fill
                  tabcontrol on a form and put a listbox there. THEN AT RESIZE of the
                  form, listbox as well as the tabcontrol flickers badly.
                  Please tell any possible solution

                  Stoitcho Goutsev (100) wrote:
                  What I did I anchored the control so it resizes when the form resizes. I
                  resized the form and as a matter of fact I can see some hardly noticable
                  flickering on the elements on the top, but nothing so drastic, but yes there
                  is some filickering. I find it strange that on my test only the first
                  element in the lisbox flickers - not the first visible, but the first in the
                  list. There are some thinks that looks like reduce the flicker, but doesn't
                  get rid of it completely:
                  1. Set IntegralHeight to *false* it looks like there is some problem and the
                  control height changes without visible reason as the list box resizes.
                  2. Try to double buffer the control. I'd expect this to remove the
                  flickering, but it looks like it only reduces it a bit. To do that you need
                  to inherit from the control and in the constructor to set DoubleBuffered
                  protected property to *true*.
                  >
                  If this doesn't give you good result trye using ListView. I haven't tried,
                  but as a more complex control it may behave better.
                  >
                  >
                  --
                  HTH
                  Stoitcho Goutsev (100)
                  >
                  This flickering can be removed if I inherit from the listbox and make it
                  double buffered.
                  <nirdeshonline@ gmail.comwrote in message
                  news:1162959996 .476212.296140@ b28g2000cwb.goo glegroups.com.. .
                  hi,
                  You might have kept a listbox on a form. Thats fine. Please run the
                  application and try to resize the form. When you resize the form all
                  the contents of the listbox reloads and gives ample amount of
                  flickering.
                  Is there any solution to this problem.
                  Thanks & Regards
                  Nirdesh

                  Stoitcho Goutsev (100) wrote:
                  Nirdesh,
                  >
                  When does the control flicker. I created a test application with listbox
                  containing 100 strings and I don't see any flickering. Either I don't
                  reproduce your case correctly or you have something esle going on in your
                  application. Can you post simple, but compilable sample that demonstrates
                  your problem.
                  >
                  >
                  --
                  Stoitcho Goutsev (100)
                  >
                  <nirdeshonline@ gmail.comwrote in message
                  news:1162910236 .400405.257850@ e3g2000cwe.goog legroups.com...
                  Hi,
                  I have added a simple listbox in windows form under c# 2.0. It contains
                  a collection of approx 10 strings as list items. Now when i resize the
                  form whole listbox flickers.

                  Please tell me any feasible solution, i need to use a checked listbox
                  which also has same flickering problem on resize.

                  Thanks & Regards

                  Nirdesh Dabas
                  nirdeshonline@g mail.com

                  Comment

                  Working...