473,717 Members | 2,223 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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
ni***********@g mail.com

Nov 7 '06 #1
8 6381
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)

<ni***********@ gmail.comwrote in message
news:11******** **************@ 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
ni***********@g mail.com

Nov 7 '06 #2
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)

<ni***********@ gmail.comwrote in message
news:11******** **************@ 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
ni***********@g mail.com
Nov 8 '06 #3
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.

Nov 8 '06 #4
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.
Nov 8 '06 #5
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.
<ni***********@ gmail.comwrote in message
news:11******** **************@ 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)

<ni*********** @gmail.comwrote in message
news:11******* *************** @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
ni***********@g mail.com

Nov 8 '06 #6
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.
<ni***********@ gmail.comwrote in message
news:11******** **************@ 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)

<ni***********@ gmail.comwrote in message
news:11******** **************@ 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
ni***********@g mail.com
Nov 8 '06 #7

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.
<ni***********@ gmail.comwrote in message
news:11******** **************@ 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)

<ni***********@ gmail.comwrote in message
news:11******** **************@ 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
ni***********@g mail.com
Nov 8 '06 #8
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.
<ni***********@ gmail.comwrote in message
news:11******** **************@ 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)

<ni***********@ gmail.comwrote in message
news:11******** **************@ 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
ni***********@g mail.com
Nov 8 '06 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2301
by: Ray | last post by:
Folks, I have just created a simple procedure that does the following: Determines the width of the columns of a listbox. Places a button of the correct size above each column as the form opens. Sorts by that column when you click the button. Automatically toggles between ASC and DESC sort sequence. To implement it on a new form, you simply copy the buttons from my
2
4095
by: Robin Senior | last post by:
Hi, I have a listBox control on my form, and it is anchored to some of the sides. When I resize my entire form, the listBox resizes less nicely than the other controls. The length of the listBox seems to jump around, due to the size of the row elements inside. Is there a way to make a listBox control resize smoothly, without the discrete jump every time it grows large enough to accomodate a new row?
2
8309
by: Jaikumar | last post by:
Hi, 1) I have created one windows application, In the main form ( form1) i have added one usercontrol (usercontrol1), In that user control i am drawing one image. 2) In the UserControl1 i am showing one transparent form (form3) when ever user preseed left mouse button. 3) The form3 has one transparent user control (usercontrol2) that paints circles. That measn the circles will show on top the usercontrol1 image. 4) The form3 border style...
8
1493
by: gv | last post by:
Ok, Hi all, new to asp.net. Simple question with web forms I have a Dropdownlist and a listbox, I want to click on and item in the dropdownlist and show items in listbox. that simple I have this: I have two items in Dropdownlist. The Reportlist doesn't show
8
2353
by: Steve Schroeder | last post by:
For some reason I cannot get the OnSelectedIndexChanged event to fire for a listbox I have on a page. I'm able to populate the listbox with data from a stored procedure, but cannot trigger the event. I do have EnableViewState = True for the listbox. I'm imagining (wanting) to populate the listbox named: lstNames by using the DataValueField from lstDepartments. It's quite apparent though that the event is not triggering as I can misname...
0
2657
by: David J | last post by:
Hi, I am strugling with the propertygrid and a listbox. I am using the universaldropdowneditor from the codeproject (code below). However I am populating the listbox via a datasource. The problem I am having is that when I have a value in the propertygird and edit that, I want the listbox to have the selectvalue equal to the value that is being edited. Just to make it clearer: PropgridVal = Germany Datasource=
2
3135
by: dan heskett | last post by:
I am owner-drawing a listbox, in an attempt to create a nice list with some custom "fields" and text layout. Essentially it works, but I must be missing something big, conceptually, because I get all kinds of screen artifacts and weirdness. My general goal is: list item with a few areas for text, every other item shaded a light color for readability, font color changes with selection. The listbox is populated with custom structurs...
3
2729
by: Reg Verrin | last post by:
I have a program that displays constantly changing prices which it sources from the web once per second. The prices are displayed on a Listbox (not the best choice but there are good reasons for this). The Listbox flickers when updating and I can't find a solution on the net. Here is the code: 'update Listbox
11
8453
by: Andrus | last post by:
1. Run code 2. Resize window Observed: Listbox flashes during resize. How to remove this flashing ? Andrus.
0
8823
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8718
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9344
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9105
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7980
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4477
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4738
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2543
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2119
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.