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

Bug with TreeView control

P: n/a
Jim
The below problem occurs randomly too, but I've managed to isolate a
sequence of events when it always happens:

I have two forms (say Form1 and Form2). Form 1 contains a TreeView control.
A button from Form1 opens Form2 and a button in Form2 sends the user back to
Form1.

When the user goes back to Form1 from Form2, the TreeView control rebuilds
the nodes incredibly slowly. You can see the progress, as the scroll bar
slowly starts sliding down. It normally takes around 30 seconds to rebuild
the tree. When the tree is finished, every node is fully expanded. Also,
when I go into edit mode, the TreeView control displays all the data, rather
than the more usual "Sample Node" mini-tree.

Can anyone help? The TreeView control is essential to my application, and I
can't expect users to wait 30 seconds each time they switch between forms
while the TreeView does its very weird stuff.

Thanks
Jim
Nov 12 '05 #1
Share this Question
Share on Google+
9 Replies


P: n/a
On Mon, 23 Feb 2004 23:05:35 -0000, Jim wrote:
The below problem occurs randomly too, but I've managed to isolate a
sequence of events when it always happens:

I have two forms (say Form1 and Form2). Form 1 contains a TreeView control.
A button from Form1 opens Form2 and a button in Form2 sends the user back to
Form1.

When the user goes back to Form1 from Form2, the TreeView control rebuilds
the nodes incredibly slowly. You can see the progress, as the scroll bar
slowly starts sliding down. It normally takes around 30 seconds to rebuild
the tree. When the tree is finished, every node is fully expanded. Also,
when I go into edit mode, the TreeView control displays all the data, rather
than the more usual "Sample Node" mini-tree.

Can anyone help? The TreeView control is essential to my application, and I
can't expect users to wait 30 seconds each time they switch between forms
while the TreeView does its very weird stuff.

Thanks
Jim


Is it possible to move the rebuilding of the tree to an event that dosen't
run as frequently? I get the feeling you are doing it OnActivate or the
like.
--
Mike Storr
www.veraccess.com
Nov 12 '05 #2

P: n/a

hmm, not clear why TV starts to rebuild. do you have some code for this run
when you switch to form? normally it just stays as it is when form
activated/deactiuvated

--
Alex Dybenko (MVP)
http://Alex.Dybenko.com
"Jim" <ji**********@nospam.virgin.net> wrote in message
news:4Gv_b.1312$ta.723@newsfe1-win...
The below problem occurs randomly too, but I've managed to isolate a
sequence of events when it always happens:

I have two forms (say Form1 and Form2). Form 1 contains a TreeView control. A button from Form1 opens Form2 and a button in Form2 sends the user back to Form1.

When the user goes back to Form1 from Form2, the TreeView control rebuilds
the nodes incredibly slowly. You can see the progress, as the scroll bar
slowly starts sliding down. It normally takes around 30 seconds to rebuild
the tree. When the tree is finished, every node is fully expanded. Also,
when I go into edit mode, the TreeView control displays all the data, rather than the more usual "Sample Node" mini-tree.

Can anyone help? The TreeView control is essential to my application, and I can't expect users to wait 30 seconds each time they switch between forms
while the TreeView does its very weird stuff.

Thanks
Jim

Nov 12 '05 #3

P: n/a
Jim
That's why it's so bizarre. I only build the tree once, yet when I switch
between forms, it rebuilds itself extremely slowly. if i get a chance, i'll
try and replicate it and give you a url to a db so you can see for yourself.

By the way, the problem fixes itself if i remove and readd the tree .... but
only temporarily.

Thanks
Jim
"Alex Dybenko" <al**@PLEASE.cemi.NO.rssi.SPAM.ru> wrote in message
news:eH****************@TK2MSFTNGP10.phx.gbl...

hmm, not clear why TV starts to rebuild. do you have some code for this run when you switch to form? normally it just stays as it is when form
activated/deactiuvated

--
Alex Dybenko (MVP)
http://Alex.Dybenko.com
"Jim" <ji**********@nospam.virgin.net> wrote in message
news:4Gv_b.1312$ta.723@newsfe1-win...
The below problem occurs randomly too, but I've managed to isolate a
sequence of events when it always happens:

I have two forms (say Form1 and Form2). Form 1 contains a TreeView control.
A button from Form1 opens Form2 and a button in Form2 sends the user back to
Form1.

When the user goes back to Form1 from Form2, the TreeView control
rebuilds the nodes incredibly slowly. You can see the progress, as the scroll bar
slowly starts sliding down. It normally takes around 30 seconds to rebuild the tree. When the tree is finished, every node is fully expanded. Also,
when I go into edit mode, the TreeView control displays all the data,

rather
than the more usual "Sample Node" mini-tree.

Can anyone help? The TreeView control is essential to my application, and I
can't expect users to wait 30 seconds each time they switch between

forms while the TreeView does its very weird stuff.

Thanks
Jim


Nov 12 '05 #4

P: n/a
Try turning off the option "Track name AutoCorrect info"?

This causes a slowdown of complex forms once the design is changed.
--
Bradley
Software Developer www.hrsystems.com.au
A Christian Response www.pastornet.net.au/response

"Jim" <ji**********@nospam.virgin.net> wrote in message
news:42a%b.20710$ft.20607@newsfe1-win...
That's why it's so bizarre. I only build the tree once, yet when I switch
between forms, it rebuilds itself extremely slowly. if i get a chance, i'll try and replicate it and give you a url to a db so you can see for yourself.
By the way, the problem fixes itself if i remove and readd the tree .... but only temporarily.

Thanks
Jim
"Alex Dybenko" <al**@PLEASE.cemi.NO.rssi.SPAM.ru> wrote in message
news:eH****************@TK2MSFTNGP10.phx.gbl...

hmm, not clear why TV starts to rebuild. do you have some code for this

run
when you switch to form? normally it just stays as it is when form
activated/deactiuvated

--
Alex Dybenko (MVP)
http://Alex.Dybenko.com
"Jim" <ji**********@nospam.virgin.net> wrote in message
news:4Gv_b.1312$ta.723@newsfe1-win...
The below problem occurs randomly too, but I've managed to isolate a
sequence of events when it always happens:

I have two forms (say Form1 and Form2). Form 1 contains a TreeView

control.
A button from Form1 opens Form2 and a button in Form2 sends the user back
to
Form1.

When the user goes back to Form1 from Form2, the TreeView control

rebuilds the nodes incredibly slowly. You can see the progress, as the scroll bar slowly starts sliding down. It normally takes around 30 seconds to rebuild the tree. When the tree is finished, every node is fully expanded. Also, when I go into edit mode, the TreeView control displays all the data,

rather
than the more usual "Sample Node" mini-tree.

Can anyone help? The TreeView control is essential to my application, and
I
can't expect users to wait 30 seconds each time they switch between

forms while the TreeView does its very weird stuff.

Thanks
Jim



Nov 12 '05 #5

P: n/a
Jim
Bradley

Thanks for your reply. It sounded like a great idea, and something I
would never have thought of. Unfortunately though, it didn't work.

I've now isolated the offending line, which is:

xTree.Object.Nodes.Clear

in the Form_Open sub (xTree being the instance of the Tree Control)

Can anyone tell me if I'm doing something blatently wrong? As I
mentioned in a previous post, I don't get this problem on other PCs,
yet the offending line, if removed, removes the problem on my PC.

Thanks
Jim

"Bradley" <br*****@REMOVETHIScomcen.com.au> wrote in message news:<k4*****************@news-server.bigpond.net.au>...
Try turning off the option "Track name AutoCorrect info"?

This causes a slowdown of complex forms once the design is changed.
--
Bradley
Software Developer www.hrsystems.com.au
A Christian Response www.pastornet.net.au/response

"Jim" <ji**********@nospam.virgin.net> wrote in message
news:42a%b.20710$ft.20607@newsfe1-win...
That's why it's so bizarre. I only build the tree once, yet when I switch
between forms, it rebuilds itself extremely slowly. if i get a chance,

i'll
try and replicate it and give you a url to a db so you can see for

yourself.

By the way, the problem fixes itself if i remove and readd the tree ....

but
only temporarily.

Thanks
Jim

Nov 12 '05 #6

P: n/a
Hi,
1. do not use form Open event - use only Load event to work with activex
controls
2. during clear operation TV redraws a lot, so try to switch it off:

SendMessage oTV.hWnd, WM_SETREDRAW, 0, ByVal 0&
oTV.Nodes.Clear
SendMessage oTV.hWnd, WM_SETREDRAW, 1, ByVal 0&

in declration section:
Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
(ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As _
Any) As Long

Public Const WM_SETREDRAW = &HB

HTH
--
Alex Dybenko (MVP)
http://Alex.Dybenko.com
http://www.PointLtd.com

"Jim" <js*****@hotmail.com> wrote in message
news:5c*************************@posting.google.co m...
Bradley

Thanks for your reply. It sounded like a great idea, and something I
would never have thought of. Unfortunately though, it didn't work.

I've now isolated the offending line, which is:

xTree.Object.Nodes.Clear

in the Form_Open sub (xTree being the instance of the Tree Control)

Can anyone tell me if I'm doing something blatently wrong? As I
mentioned in a previous post, I don't get this problem on other PCs,
yet the offending line, if removed, removes the problem on my PC.

Thanks
Jim

"Bradley" <br*****@REMOVETHIScomcen.com.au> wrote in message

news:<k4*****************@news-server.bigpond.net.au>...
Try turning off the option "Track name AutoCorrect info"?

This causes a slowdown of complex forms once the design is changed.
--
Bradley
Software Developer www.hrsystems.com.au
A Christian Response www.pastornet.net.au/response

"Jim" <ji**********@nospam.virgin.net> wrote in message
news:42a%b.20710$ft.20607@newsfe1-win...
That's why it's so bizarre. I only build the tree once, yet when I switch between forms, it rebuilds itself extremely slowly. if i get a chance,

i'll
try and replicate it and give you a url to a db so you can see for

yourself.

By the way, the problem fixes itself if i remove and readd the tree
..... but
only temporarily.

Thanks
Jim

Nov 12 '05 #7

P: n/a
Jim
Alex, I can't thank you enough. This has worked perfectly!!!

Jim

"Alex Dybenko" <al**@PLEASE.cemi.NO.rssi.SPAM.ru> wrote in message news:<ue**************@TK2MSFTNGP10.phx.gbl>...
Hi,
1. do not use form Open event - use only Load event to work with activex
controls
2. during clear operation TV redraws a lot, so try to switch it off:

SendMessage oTV.hWnd, WM_SETREDRAW, 0, ByVal 0&
oTV.Nodes.Clear
SendMessage oTV.hWnd, WM_SETREDRAW, 1, ByVal 0&

in declration section:
Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
(ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As _
Any) As Long

Public Const WM_SETREDRAW = &HB

HTH
--
Alex Dybenko (MVP)
http://Alex.Dybenko.com
http://www.PointLtd.com

"Jim" <js*****@hotmail.com> wrote in message
news:5c*************************@posting.google.co m...
Bradley

Thanks for your reply. It sounded like a great idea, and something I
would never have thought of. Unfortunately though, it didn't work.

I've now isolated the offending line, which is:

xTree.Object.Nodes.Clear

in the Form_Open sub (xTree being the instance of the Tree Control)

Can anyone tell me if I'm doing something blatently wrong? As I
mentioned in a previous post, I don't get this problem on other PCs,
yet the offending line, if removed, removes the problem on my PC.

Thanks
Jim

"Bradley" <br*****@REMOVETHIScomcen.com.au> wrote in message

news:<k4*****************@news-server.bigpond.net.au>...
Try turning off the option "Track name AutoCorrect info"?

This causes a slowdown of complex forms once the design is changed.
--
Bradley
Software Developer www.hrsystems.com.au
A Christian Response www.pastornet.net.au/response

"Jim" <ji**********@nospam.virgin.net> wrote in message
news:42a%b.20710$ft.20607@newsfe1-win...
> That's why it's so bizarre. I only build the tree once, yet when I switch > between forms, it rebuilds itself extremely slowly. if i get a chance, i'll > try and replicate it and give you a url to a db so you can see for yourself. >
> By the way, the problem fixes itself if i remove and readd the tree ....
but > only temporarily.
>
> Thanks
> Jim

Nov 12 '05 #8

P: n/a

Jim <js*****@hotmail.com> wrote in message
news:5c**************************@posting.google.c om...
Alex, I can't thank you enough. This has worked perfectly!!!

Jim

"Alex Dybenko" <al**@PLEASE.cemi.NO.rssi.SPAM.ru> wrote in message

news:<ue**************@TK2MSFTNGP10.phx.gbl>...
Hi,
1. do not use form Open event - use only Load event to work with activex
controls
2. during clear operation TV redraws a lot, so try to switch it off:

SendMessage oTV.hWnd, WM_SETREDRAW, 0, ByVal 0&
oTV.Nodes.Clear
SendMessage oTV.hWnd, WM_SETREDRAW, 1, ByVal 0&

in declration section:
Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
(ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As _ Any) As Long

Public Const WM_SETREDRAW = &HB

HTH
--
Alex Dybenko (MVP)
http://Alex.Dybenko.com
http://www.PointLtd.com

"Jim" <js*****@hotmail.com> wrote in message
news:5c*************************@posting.google.co m...
Bradley

Thanks for your reply. It sounded like a great idea, and something I
would never have thought of. Unfortunately though, it didn't work.

I've now isolated the offending line, which is:

xTree.Object.Nodes.Clear

in the Form_Open sub (xTree being the instance of the Tree Control)

Can anyone tell me if I'm doing something blatently wrong? As I
mentioned in a previous post, I don't get this problem on other PCs,
yet the offending line, if removed, removes the problem on my PC.

Thanks
Jim

"Bradley" <br*****@REMOVETHIScomcen.com.au> wrote in message

news:<k4*****************@news-server.bigpond.net.au>...
> Try turning off the option "Track name AutoCorrect info"?
>
> This causes a slowdown of complex forms once the design is changed.
> --
> Bradley
> Software Developer www.hrsystems.com.au
> A Christian Response www.pastornet.net.au/response
>
> "Jim" <ji**********@nospam.virgin.net> wrote in message
> news:42a%b.20710$ft.20607@newsfe1-win...
> > That's why it's so bizarre. I only build the tree once, yet when I

switch
> > between forms, it rebuilds itself extremely slowly. if i get a
chance, i'll
> > try and replicate it and give you a url to a db so you can see for

yourself.
> >
> > By the way, the problem fixes itself if i remove and readd the
tree ....
but
> > only temporarily.
> >
> > Thanks
> > Jim

Nov 12 '05 #9

P: n/a

Jim <js*****@hotmail.com> wrote in message
news:5c**************************@posting.google.c om...
Alex, I can't thank you enough. This has worked perfectly!!!

Jim

"Alex Dybenko" <al**@PLEASE.cemi.NO.rssi.SPAM.ru> wrote in message

news:<ue**************@TK2MSFTNGP10.phx.gbl>...
Hi,
1. do not use form Open event - use only Load event to work with activex
controls
2. during clear operation TV redraws a lot, so try to switch it off:

SendMessage oTV.hWnd, WM_SETREDRAW, 0, ByVal 0&
oTV.Nodes.Clear
SendMessage oTV.hWnd, WM_SETREDRAW, 1, ByVal 0&

in declration section:
Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
(ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As _ Any) As Long

Public Const WM_SETREDRAW = &HB

HTH
--
Alex Dybenko (MVP)
http://Alex.Dybenko.com
http://www.PointLtd.com

"Jim" <js*****@hotmail.com> wrote in message
news:5c*************************@posting.google.co m...
Bradley

Thanks for your reply. It sounded like a great idea, and something I
would never have thought of. Unfortunately though, it didn't work.

I've now isolated the offending line, which is:

xTree.Object.Nodes.Clear

in the Form_Open sub (xTree being the instance of the Tree Control)

Can anyone tell me if I'm doing something blatently wrong? As I
mentioned in a previous post, I don't get this problem on other PCs,
yet the offending line, if removed, removes the problem on my PC.

Thanks
Jim

"Bradley" <br*****@REMOVETHIScomcen.com.au> wrote in message

news:<k4*****************@news-server.bigpond.net.au>...
> Try turning off the option "Track name AutoCorrect info"?
>
> This causes a slowdown of complex forms once the design is changed.
> --
> Bradley
> Software Developer www.hrsystems.com.au
> A Christian Response www.pastornet.net.au/response
>
> "Jim" <ji**********@nospam.virgin.net> wrote in message
> news:42a%b.20710$ft.20607@newsfe1-win...
> > That's why it's so bizarre. I only build the tree once, yet when I

switch
> > between forms, it rebuilds itself extremely slowly. if i get a
chance, i'll
> > try and replicate it and give you a url to a db so you can see for

yourself.
> >
> > By the way, the problem fixes itself if i remove and readd the
tree ....
but
> > only temporarily.
> >
> > Thanks
> > Jim

Nov 12 '05 #10

This discussion thread is closed

Replies have been disabled for this discussion.