473,666 Members | 2,299 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2084
how many times do you call begin/end update for the second tree?

"Etienne" <oh> wrote in message news:lP******** ************@b2 b2c.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..BeginUpda te 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******** ************@b2 b2c.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******** ************@b2 b2c.ca...
Only once, in the Button.Click event. BeginUpdate is the first line and
EndUpdate the last line..BeginUpda te 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******** ************@b2 b2c.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.BeginU pdate();
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.EndUpd ate();

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******** ************@b2 b2c.ca...
Only once, in the Button.Click event. BeginUpdate is the first line and
EndUpdate the last line..BeginUpda te 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******** ************@b2 b2c.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******** ************@b2 b2c.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.BeginU pdate();
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.EndUpd ate();

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******** ************@b2 b2c.ca...
Only once, in the Button.Click event. BeginUpdate is the first line and
EndUpdate the last line..BeginUpda te 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******** ************@b2 b2c.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******** ************@b2 b2c.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.BeginU pdate();
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.EndUpd ate();

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******** ************@b2 b2c.ca...
Only once, in the Button.Click event. BeginUpdate is the first line and
EndUpdate the last line..BeginUpda te 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******** ************@b2 b2c.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
315
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? -------------------------------- From: SJ ----------------------- Posted by a user from .NET 247 (http://www.dotnet247.com/)
2
5658
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 for other controls. I really need a function like this for other controls because of the flickering when I update many properties of a single control at a time. I would like to inherite a control and add to it beginupdate and endupdate...
6
2838
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 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...
1
1706
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- usingtreeviewiewebcontrol.asp
1
2556
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: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwindowsformsdatagridcolumnstyleclassbeginupdatetopic.asp Unfortunately it doesn't work with me: In some way I should make a derived class from the DataGridColumnStyle but I'm not able to do it. Des anybody knows how to do this?
0
1149
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 with IIS 6. The treeview was not drawn and all I could see was strings with the node names. The solution to my problem was changing the security settings of Internet Explorer for the Internet zone by enabling "Active scripting" and "Binary script...
3
1502
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 postback. MS doesn't seem to have any official documentation on this. And please notice I'm not refering to IE TreeView control but asp.net 2.0's TreeView!
1
2423
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 sorry for reposting but I've already googled for hours and I see others have asked about this here without getting replies, this is starting to look like some Bermuda phenomenon nobody wants to answer to! I really need to accomplish the task below...
4
2122
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 = "ContentSites.URL" URLListBox.EndUpdate() The program execution insistis on going to the Sub URLListBox_SelectedIndexChanged after the 2nd line (URLListBox.DataSource =...) It does this for each item in the DataSet. Isn't this exactly what
0
8866
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
8550
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
8639
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7385
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
5663
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4198
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
4366
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2011
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1772
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.