473,387 Members | 1,502 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,387 software developers and data experts.

BeginUpdate not working for 2nd TreeView

Hi, I have a form containing 2 TreeViews. When I click on a button, items
are transfered from the left tree to the right tree, which causes
flickering. In order to remove such flickering, I surrounded code with
BeginUpdate/EndUpdate for both trees. The left tree doesn't flicker anymore,
but the right one still does!! Even if I call BeginUpdate/EndUpdate on the
right tree only, it still flickers. What's going on here? Is BeginUpdate
working only for the first TreeView of a form or what?

Thanks for your help!
Etienne
Jul 21 '05 #1
6 2064
how many times do you call begin/end update for the second tree?

"Etienne" <oh> wrote in message news:lP********************@b2b2c.ca...
Hi, I have a form containing 2 TreeViews. When I click on a button, items
are transfered from the left tree to the right tree, which causes
flickering. In order to remove such flickering, I surrounded code with
BeginUpdate/EndUpdate for both trees. The left tree doesn't flicker
anymore, but the right one still does!! Even if I call
BeginUpdate/EndUpdate on the right tree only, it still flickers. What's
going on here? Is BeginUpdate working only for the first TreeView of a
form or what?

Thanks for your help!
Etienne

Jul 21 '05 #2
Only once, in the Button.Click event. BeginUpdate is the first line and
EndUpdate the last line..BeginUpdate isn't ever called before. Also, I
disabled XP Theme just to be sure this isn't the problem.

Etienne

"Joep" <St***@DeStoep.nl> wrote in message
news:41***********************@news.xs4all.nl...
how many times do you call begin/end update for the second tree?

"Etienne" <oh> wrote in message news:lP********************@b2b2c.ca...
Hi, I have a form containing 2 TreeViews. When I click on a button, items
are transfered from the left tree to the right tree, which causes
flickering. In order to remove such flickering, I surrounded code with
BeginUpdate/EndUpdate for both trees. The left tree doesn't flicker
anymore, but the right one still does!! Even if I call
BeginUpdate/EndUpdate on the right tree only, it still flickers. What's
going on here? Is BeginUpdate working only for the first TreeView of a
form or what?

Thanks for your help!
Etienne


Jul 21 '05 #3
what does the transfer proces look like? are you taking a node out of the
left tree and then put that node into the right tree and then loop? or are
you copying a node from the left tree, putting it into the right tree, then
loop and finally removing all nodes from the left tree? is there a
difference between the two methods with respect to flicker?

"Etienne" <oh> wrote in message news:4N********************@b2b2c.ca...
Only once, in the Button.Click event. BeginUpdate is the first line and
EndUpdate the last line..BeginUpdate isn't ever called before. Also, I
disabled XP Theme just to be sure this isn't the problem.

Etienne

"Joep" <St***@DeStoep.nl> wrote in message
news:41***********************@news.xs4all.nl...
how many times do you call begin/end update for the second tree?

"Etienne" <oh> wrote in message news:lP********************@b2b2c.ca...
Hi, I have a form containing 2 TreeViews. When I click on a button,
items are transfered from the left tree to the right tree, which causes
flickering. In order to remove such flickering, I surrounded code with
BeginUpdate/EndUpdate for both trees. The left tree doesn't flicker
anymore, but the right one still does!! Even if I call
BeginUpdate/EndUpdate on the right tree only, it still flickers. What's
going on here? Is BeginUpdate working only for the first TreeView of a
form or what?

Thanks for your help!
Etienne



Jul 21 '05 #4
I found where the problem is. Whenever I edit the text of an existing node,
it causes the tree to redraw even if BeginUpdate was called. Here's a sample
code to reproduce the problem :

destTree.BeginUpdate();
TreeNode n = null, p = null;
for (int i=0; i<50; i++) {
p = n;
n = destTree.Nodes.Add("test");
if (p != null) // If you comment those 2 lines, it no longer redraws.
p.Text = "*" + p.Text;
}
destTree.EndUpdate();

This causes the treeview to redraw for every item. Any idea for a
work-around? I tried subclassing and blocking WM_PAINT (0xF) after
BeginUpdate is called, but this doesn't solve the problem.

Etienne

"Joep" <St***@DeStoep.nl> wrote in message
news:42***********************@news.xs4all.nl...
what does the transfer proces look like? are you taking a node out of the
left tree and then put that node into the right tree and then loop? or are
you copying a node from the left tree, putting it into the right tree,
then loop and finally removing all nodes from the left tree? is there a
difference between the two methods with respect to flicker?

"Etienne" <oh> wrote in message news:4N********************@b2b2c.ca...
Only once, in the Button.Click event. BeginUpdate is the first line and
EndUpdate the last line..BeginUpdate isn't ever called before. Also, I
disabled XP Theme just to be sure this isn't the problem.

Etienne

"Joep" <St***@DeStoep.nl> wrote in message
news:41***********************@news.xs4all.nl...
how many times do you call begin/end update for the second tree?

"Etienne" <oh> wrote in message news:lP********************@b2b2c.ca...
Hi, I have a form containing 2 TreeViews. When I click on a button,
items are transfered from the left tree to the right tree, which causes
flickering. In order to remove such flickering, I surrounded code with
BeginUpdate/EndUpdate for both trees. The left tree doesn't flicker
anymore, but the right one still does!! Even if I call
BeginUpdate/EndUpdate on the right tree only, it still flickers. What's
going on here? Is BeginUpdate working only for the first TreeView of a
form or what?

Thanks for your help!
Etienne

Jul 21 '05 #5
the edit is a new feature, anyway, have a look

http://www.codeproject.com/cs/miscctrl/listviewff.asp
"Etienne" <oh> wrote in message news:v8********************@b2b2c.ca...
I found where the problem is. Whenever I edit the text of an existing node,
it causes the tree to redraw even if BeginUpdate was called. Here's a
sample code to reproduce the problem :

destTree.BeginUpdate();
TreeNode n = null, p = null;
for (int i=0; i<50; i++) {
p = n;
n = destTree.Nodes.Add("test");
if (p != null) // If you comment those 2 lines, it no longer redraws.
p.Text = "*" + p.Text;
}
destTree.EndUpdate();

This causes the treeview to redraw for every item. Any idea for a
work-around? I tried subclassing and blocking WM_PAINT (0xF) after
BeginUpdate is called, but this doesn't solve the problem.

Etienne

"Joep" <St***@DeStoep.nl> wrote in message
news:42***********************@news.xs4all.nl...
what does the transfer proces look like? are you taking a node out of the
left tree and then put that node into the right tree and then loop? or
are you copying a node from the left tree, putting it into the right
tree, then loop and finally removing all nodes from the left tree? is
there a difference between the two methods with respect to flicker?

"Etienne" <oh> wrote in message news:4N********************@b2b2c.ca...
Only once, in the Button.Click event. BeginUpdate is the first line and
EndUpdate the last line..BeginUpdate isn't ever called before. Also, I
disabled XP Theme just to be sure this isn't the problem.

Etienne

"Joep" <St***@DeStoep.nl> wrote in message
news:41***********************@news.xs4all.nl...
how many times do you call begin/end update for the second tree?

"Etienne" <oh> wrote in message news:lP********************@b2b2c.ca...
> Hi, I have a form containing 2 TreeViews. When I click on a button,
> items are transfered from the left tree to the right tree, which
> causes flickering. In order to remove such flickering, I surrounded
> code with BeginUpdate/EndUpdate for both trees. The left tree doesn't
> flicker anymore, but the right one still does!! Even if I call
> BeginUpdate/EndUpdate on the right tree only, it still flickers.
> What's going on here? Is BeginUpdate working only for the first
> TreeView of a form or what?
>
> Thanks for your help!
> Etienne


Jul 21 '05 #6
This article doesn't solve my problem, but I tried blocking both WM_PAINT
and WM_ERASEBKGND. There is not much flickering anymore! The scrollbars
still flicker, but at least not the content. Is there a way to stop
redrawing of scrollbars?

Etienne

"Joep" <St***@DeStoep.nl> wrote in message
news:42***********************@news.xs4all.nl...
the edit is a new feature, anyway, have a look

http://www.codeproject.com/cs/miscctrl/listviewff.asp
"Etienne" <oh> wrote in message news:v8********************@b2b2c.ca...
I found where the problem is. Whenever I edit the text of an existing
node, it causes the tree to redraw even if BeginUpdate was called. Here's
a sample code to reproduce the problem :

destTree.BeginUpdate();
TreeNode n = null, p = null;
for (int i=0; i<50; i++) {
p = n;
n = destTree.Nodes.Add("test");
if (p != null) // If you comment those 2 lines, it no longer redraws.
p.Text = "*" + p.Text;
}
destTree.EndUpdate();

This causes the treeview to redraw for every item. Any idea for a
work-around? I tried subclassing and blocking WM_PAINT (0xF) after
BeginUpdate is called, but this doesn't solve the problem.

Etienne

"Joep" <St***@DeStoep.nl> wrote in message
news:42***********************@news.xs4all.nl...
what does the transfer proces look like? are you taking a node out of
the left tree and then put that node into the right tree and then loop?
or are you copying a node from the left tree, putting it into the right
tree, then loop and finally removing all nodes from the left tree? is
there a difference between the two methods with respect to flicker?

"Etienne" <oh> wrote in message news:4N********************@b2b2c.ca...
Only once, in the Button.Click event. BeginUpdate is the first line and
EndUpdate the last line..BeginUpdate isn't ever called before. Also, I
disabled XP Theme just to be sure this isn't the problem.

Etienne

"Joep" <St***@DeStoep.nl> wrote in message
news:41***********************@news.xs4all.nl...
> how many times do you call begin/end update for the second tree?
>
> "Etienne" <oh> wrote in message
> news:lP********************@b2b2c.ca...
>> Hi, I have a form containing 2 TreeViews. When I click on a button,
>> items are transfered from the left tree to the right tree, which
>> causes flickering. In order to remove such flickering, I surrounded
>> code with BeginUpdate/EndUpdate for both trees. The left tree doesn't
>> flicker anymore, but the right one still does!! Even if I call
>> BeginUpdate/EndUpdate on the right tree only, it still flickers.
>> What's going on here? Is BeginUpdate working only for the first
>> TreeView of a form or what?
>>
>> Thanks for your help!
>> Etienne



Jul 21 '05 #7

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

Similar topics

0
by: SJ via .NET 247 | last post by:
For some reason, the scrollbars in my treeview component are not working. The scrollable property is set to True. I have the treeview in a panel. Does that make any difference? ...
2
by: shumaker | last post by:
A few form controls have a Beginupdate function that stops the control from being painted until endupdate is called, and I'm wondering if anyone has an idea of how to implement a function like this...
6
by: Etienne | last post by:
Hi, I have a form containing 2 TreeViews. When I click on a button, items are transfered from the left tree to the right tree, which causes flickering. In order to remove such flickering, I...
1
by: Rog | last post by:
Hello, Yesterday I downloaded IEwebcontrols.exe and TreeviewControl.msi from http://msdn.microsoft.com/library/default.asp? url=/library/en-us/dnaspp/html/aspnet-...
1
by: DraguVaso | last post by:
Hi, I found on the net that it is possible to use the BeginUpdate end EndUpdate-methods with a DataGrid:...
0
by: ada | last post by:
Hi, I had this problem and couldn't find a solution. An ASP .NET treeview ieWebcontrol worked fine in my ASP .NET 1.1 application, but stopped working when installed in a Windows Server 2003...
3
by: Daves | last post by:
is there any documentation out there to find out if and then how I can work with TreeView on client side through jscript? For example I want to change title of nodes and remove without doing...
1
by: Daves | last post by:
Sorry folks but I will be reposting this question from 6/5 until someone gives me an answer - the question is very easy and so ought the answer to be. I really need the answer! ------- I'm...
4
by: Anil Gupte | last post by:
I am using the following code: URLListBox.BeginUpdate() URLListBox.DataSource = DSContent '.Tables("ContentSites") URLListBox.DisplayMember = "ContentSites.SiteName" URLListBox.ValueMember =...
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: 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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.