By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,654 Members | 1,583 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,654 IT Pros & Developers. It's quick & easy.

listview

P: n/a
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
Share this Question
Share on Google+
12 Replies


P: n/a
Hi Derian,

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

Regards,
Fergus
Nov 20 '05 #2

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
* "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

P: n/a
* ":\\\\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

P: n/a
Hi Herfried,

!! ListBox? ListView? List***?

There's no need for swearing, surely!?

;-))

Regards,
Fergus

Nov 20 '05 #11

P: n/a
* "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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.