473,378 Members | 1,619 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

listview

I'm sure you guys have heard this time and time again but here is 1 more
time

How can i rapidly update a listview w/o that constant flicker?
I've researched this issue before and have tried countless solutions like
subclassing the control, locking the line, creating a new line in the
background and replacing it with the current line after the update is
complete... they all seem to be useless! Is there any possible way to fix
this issue or is there maybe a <free> 3rd party control i could incorporate
into my project?

all suggestions welcome
:\\derian
Nov 20 '05 #1
12 2937
Hi Derian,

How did you get on with the chess? I didn't get a reply. :-(

Regards,
Fergus
Nov 20 '05 #2
You should be able to double-buffer all controls in windoze forms.
Something like:
Public Class ListViewDblBuffer
Inherits ListView

Public Sub New()

MyBase.New()
Me.SetStyle(ControlStyles.DoubleBuffer, True)
Me.SetStyle(ControlStyles.Opaque, True)

End Sub
End Class

":\\derian" <de****@someplace.com> wrote in message
news:%2***************@TK2MSFTNGP10.phx.gbl...
I'm sure you guys have heard this time and time again but here is 1 more
time

How can i rapidly update a listview w/o that constant flicker?
I've researched this issue before and have tried countless solutions like
subclassing the control, locking the line, creating a new line in the
background and replacing it with the current line after the update is
complete... they all seem to be useless! Is there any possible way to fix
this issue or is there maybe a <free> 3rd party control i could incorporate into my project?

all suggestions welcome
:\\derian

Nov 20 '05 #3
You actually remembered eh...
well all the coding is done for a 2 player network game. I'm in the process
of commenting the code but its coming slowly b/c i work 8-6 developing
software and it would look really bad if I were coding games while i was
supposed to be coding something else. I'm just not quite as motivated to
comment now that the real coding is complete.

Ideally, i'd like to get some form of AI for the human vs computer match.
That is much further down the road.

Back to my listview question... Any ideas?

"Fergus Cooney" <fi******@tesco.net> wrote in message
news:eo**************@TK2MSFTNGP11.phx.gbl...
Hi Derian,

How did you get on with the chess? I didn't get a reply. :-(

Regards,
Fergus

Nov 20 '05 #4
Having said that - I've double bufferred my list view and list box controls
and I don't see any whoppy-do-dah flicker freeness. I even went as far as
to write my own double bufferring for my list box items (which are custom
drawn anyway). I don't know - there isn't a whole lot of documentation
about windows forms double bufferring anyway. Seems to me like a pretty
important feature.

"Robin Tucker" <id*************************@reallyidont.com> wrote in
message news:bm*******************@news.demon.co.uk...
You should be able to double-buffer all controls in windoze forms.
Something like:
Public Class ListViewDblBuffer
Inherits ListView

Public Sub New()

MyBase.New()
Me.SetStyle(ControlStyles.DoubleBuffer, True)
Me.SetStyle(ControlStyles.Opaque, True)

End Sub
End Class

":\\derian" <de****@someplace.com> wrote in message
news:%2***************@TK2MSFTNGP10.phx.gbl...
I'm sure you guys have heard this time and time again but here is 1 more
time

How can i rapidly update a listview w/o that constant flicker?
I've researched this issue before and have tried countless solutions like subclassing the control, locking the line, creating a new line in the
background and replacing it with the current line after the update is
complete... they all seem to be useless! Is there any possible way to fix this issue or is there maybe a <free> 3rd party control i could

incorporate
into my project?

all suggestions welcome
:\\derian


Nov 20 '05 #5
Hi Robin, How did you double-buffer your listbox items? A ListBox item isn't
derived from control...

--
HTH,
-- Tom Spink, Über Geek

Please respond to the newsgroup,
so all can benefit

" System.Reflection Master "

==== Converting to 2002 ====
Remove inline declarations
"Robin Tucker" <id*************************@reallyidont.com> wrote in
message news:bm*******************@news.demon.co.uk...
Having said that - I've double bufferred my list view and list box controls and I don't see any whoppy-do-dah flicker freeness. I even went as far as
to write my own double bufferring for my list box items (which are custom
drawn anyway). I don't know - there isn't a whole lot of documentation
about windows forms double bufferring anyway. Seems to me like a pretty
important feature.

"Robin Tucker" <id*************************@reallyidont.com> wrote in
message news:bm*******************@news.demon.co.uk...
You should be able to double-buffer all controls in windoze forms.
Something like:
Public Class ListViewDblBuffer
Inherits ListView

Public Sub New()

MyBase.New()
Me.SetStyle(ControlStyles.DoubleBuffer, True)
Me.SetStyle(ControlStyles.Opaque, True)

End Sub
End Class

":\\derian" <de****@someplace.com> wrote in message
news:%2***************@TK2MSFTNGP10.phx.gbl...
I'm sure you guys have heard this time and time again but here is 1 more time

How can i rapidly update a listview w/o that constant flicker?
I've researched this issue before and have tried countless solutions like subclassing the control, locking the line, creating a new line in the
background and replacing it with the current line after the update is
complete... they all seem to be useless! Is there any possible way to fix this issue or is there maybe a <free> 3rd party control i could

incorporate
into my project?

all suggestions welcome
:\\derian



Nov 20 '05 #6
No it isn't. I'm handling the "DrawItem" event in the list box and
rendering my list item to a backbuffer, then blitting it to the Graphics
context "DrawItem" gives me with e.Graphics.DrawImage(backBuffer,
e.Bounds.X, e.Bounds.Y). Create a backbuffer as large as the list item (I'm
creating it in the "DrawItem" event, but it would be quicker to maintain one
outside I suppose), do all your drawing to that and then just blit.

So everything gets drawn to the backBuffer image context. My list items
contain text, images and other stuff (and are quite large). This has
reduced flicked quite a bit. The control as a whole still flickers somewhat
though, but I'm not going to look at that until I've finished this project
(it isn't that bad - could do with some optimisations here and there I
suppose).
"Tom Spink" <th**********@ntlworld.com> wrote in message
news:ew*************@TK2MSFTNGP11.phx.gbl...
Hi Robin, How did you double-buffer your listbox items? A ListBox item isn't derived from control...

--
HTH,
-- Tom Spink, Über Geek

Please respond to the newsgroup,
so all can benefit

" System.Reflection Master "

==== Converting to 2002 ====
Remove inline declarations
"Robin Tucker" <id*************************@reallyidont.com> wrote in
message news:bm*******************@news.demon.co.uk...
Having said that - I've double bufferred my list view and list box

controls
and I don't see any whoppy-do-dah flicker freeness. I even went as far as
to write my own double bufferring for my list box items (which are custom drawn anyway). I don't know - there isn't a whole lot of documentation
about windows forms double bufferring anyway. Seems to me like a pretty
important feature.

"Robin Tucker" <id*************************@reallyidont.com> wrote in
message news:bm*******************@news.demon.co.uk...
You should be able to double-buffer all controls in windoze forms.
Something like:
Public Class ListViewDblBuffer
Inherits ListView

Public Sub New()

MyBase.New()
Me.SetStyle(ControlStyles.DoubleBuffer, True)
Me.SetStyle(ControlStyles.Opaque, True)

End Sub
End Class

":\\derian" <de****@someplace.com> wrote in message
news:%2***************@TK2MSFTNGP10.phx.gbl...
> I'm sure you guys have heard this time and time again but here is 1 more > time
>
> How can i rapidly update a listview w/o that constant flicker?
> I've researched this issue before and have tried countless solutions

like
> subclassing the control, locking the line, creating a new line in the > background and replacing it with the current line after the update is > complete... they all seem to be useless! Is there any possible way

to fix
> this issue or is there maybe a <free> 3rd party control i could
incorporate
> into my project?
>
> all suggestions welcome
> :\\derian
>
>



Nov 20 '05 #7
No cigar... the flickering was reduced by about 20% but its still noticable
enough to be annonying as all hell... any other suggestions?

"Robin Tucker" <id*************************@reallyidont.com> wrote in
message news:bm*******************@news.demon.co.uk...
You should be able to double-buffer all controls in windoze forms.
Something like:
Public Class ListViewDblBuffer
Inherits ListView

Public Sub New()

MyBase.New()
Me.SetStyle(ControlStyles.DoubleBuffer, True)
Me.SetStyle(ControlStyles.Opaque, True)

End Sub
End Class

":\\derian" <de****@someplace.com> wrote in message
news:%2***************@TK2MSFTNGP10.phx.gbl...
I'm sure you guys have heard this time and time again but here is 1 more
time

How can i rapidly update a listview w/o that constant flicker?
I've researched this issue before and have tried countless solutions like subclassing the control, locking the line, creating a new line in the
background and replacing it with the current line after the update is
complete... they all seem to be useless! Is there any possible way to fix this issue or is there maybe a <free> 3rd party control i could

incorporate
into my project?

all suggestions welcome
:\\derian


Nov 20 '05 #8
* "Tom Spink" <th**********@ntlworld.com> scripsit:
How did you double-buffer your listbox items? A ListBox item isn't
derived from control...


ListBox? ListView? List***?

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #9
* ":\\\\derian" <de****@someplace.com> scripsit:
How can i rapidly update a listview w/o that constant flicker?


<http://www.codeproject.com/cs/miscctrl/listviewxp.asp>

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #10
Hi Herfried,

!! ListBox? ListView? List***?

There's no need for swearing, surely!?

;-))

Regards,
Fergus

Nov 20 '05 #11
* "Fergus Cooney" <fi******@tesco.net> scripsit:
!! ListBox? ListView? List***?

There's no need for swearing, surely!?


ROFL

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #12
Hi Robin, I see. Nice :-)

--
HTH,
-- Tom Spink, Über Geek

Please respond to the newsgroup,
so all can benefit

" System.Reflection Master "

==== Converting to 2002 ====
Remove inline declarations
"Robin Tucker" <id*************************@reallyidont.com> wrote in
message news:bm*******************@news.demon.co.uk...
No it isn't. I'm handling the "DrawItem" event in the list box and
rendering my list item to a backbuffer, then blitting it to the Graphics
context "DrawItem" gives me with e.Graphics.DrawImage(backBuffer,
e.Bounds.X, e.Bounds.Y). Create a backbuffer as large as the list item (I'm creating it in the "DrawItem" event, but it would be quicker to maintain one outside I suppose), do all your drawing to that and then just blit.

So everything gets drawn to the backBuffer image context. My list items
contain text, images and other stuff (and are quite large). This has
reduced flicked quite a bit. The control as a whole still flickers somewhat though, but I'm not going to look at that until I've finished this project
(it isn't that bad - could do with some optimisations here and there I
suppose).
"Tom Spink" <th**********@ntlworld.com> wrote in message
news:ew*************@TK2MSFTNGP11.phx.gbl...
Hi Robin, How did you double-buffer your listbox items? A ListBox item isn't
derived from control...

--
HTH,
-- Tom Spink, Über Geek

Please respond to the newsgroup,
so all can benefit

" System.Reflection Master "

==== Converting to 2002 ====
Remove inline declarations
"Robin Tucker" <id*************************@reallyidont.com> wrote in
message news:bm*******************@news.demon.co.uk...
Having said that - I've double bufferred my list view and list box

controls
and I don't see any whoppy-do-dah flicker freeness. I even went as far as
to write my own double bufferring for my list box items (which are custom drawn anyway). I don't know - there isn't a whole lot of
documentation about windows forms double bufferring anyway. Seems to me like a pretty important feature.

"Robin Tucker" <id*************************@reallyidont.com> wrote in
message news:bm*******************@news.demon.co.uk...
> You should be able to double-buffer all controls in windoze forms.
> Something like:
>
>
> Public Class ListViewDblBuffer
> Inherits ListView
>
> Public Sub New()
>
> MyBase.New()
> Me.SetStyle(ControlStyles.DoubleBuffer, True)
> Me.SetStyle(ControlStyles.Opaque, True)
>
> End Sub
> End Class
>
> ":\\derian" <de****@someplace.com> wrote in message
> news:%2***************@TK2MSFTNGP10.phx.gbl...
> > I'm sure you guys have heard this time and time again but here is 1
more
> > time
> >
> > How can i rapidly update a listview w/o that constant flicker?
> > I've researched this issue before and have tried countless
solutions like
> > subclassing the control, locking the line, creating a new line in

the > > background and replacing it with the current line after the update is > > complete... they all seem to be useless! Is there any possible
way to fix
> > this issue or is there maybe a <free> 3rd party control i could
> incorporate
> > into my project?
> >
> > all suggestions welcome
> > :\\derian
> >
> >
>
>



Nov 20 '05 #13

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

Similar topics

6
by: Anushya | last post by:
Hi I am using Listview and inherited listview control overriding WndProc & PreProcessMessage in ListView. I need this to customize listview to display only the page the user scrolls to. Since i...
0
by: Anushya | last post by:
Hi I am using Listview and inherited listview control overriding WndProc & PreProcessMessage in ListView. I need this to customize listview to display only the page the user scrolls to. Since i...
0
by: keith | last post by:
In a ListView control (two columns), I added a few ListView items. ListView listview=new ListView(); listview.Parent=this; listview.View=View.Details; listview.Columns.Add...
7
by: Dave Y | last post by:
I am a newbie to C# and am having trouble trying to override a ListView property method. I have created a new class derived from the Forms.Listview and I cannot figure out the syntax to override...
7
by: BobAchgill | last post by:
I am trying to decide which of these controls to use to implement letting my user select a full row from MyList. The MyList has several columns which would be nice to sort by at run time. The...
5
by: John Devlon | last post by:
Hi, Does anyone know how to get a value of a second column of a selected item in Listview. I've create a listview and added this code Listview.Items.Clear() Listview.Columns.Clear()...
0
by: Peter | last post by:
Hi, I have a problem with Listview using checkboxes. If i check items by code BEFORE the form is shown the Listview.Items are confused during the ItemChecked Event !!! After showing the...
2
by: Peter | last post by:
Hi, I have a problem with Listview using checkboxes. If i check items by code BEFORE the form is shown the Listview.Items are confused during the ItemChecked Event !!! After showing the...
4
by: Brian Gaze | last post by:
I have created a ListView control and have bound this to a datasource. Within the ItemTemplate of the ListView I have added another ListViewControl which is databound in the code behind. The idea...
1
by: =?Utf-8?B?UmF5IE1pdGNoZWxs?= | last post by:
Hello, In my application I need to periodically remove all current items from a ListView and add a new set into it. The following abbreviated code contains the basic idea: private void...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.