treeview control 2.0 scroll to top

H

hgirma

Hello Gurus,

After loading my treeview control in windows form, how to i scroll to
the top and select the 1st node?

Any help is greatly appreciated
 
H

hgirma

Hello,
that was my 1st attempt as well, but it did not work, it's selected(not
visible), but my tree is at the bottom still. When the tree gets
populated, the scroller grows and once it's done, it's at the bottom of
the tree :(

thanks for the suggestion!
tv.SelectedNode = tv.Nodes[0];

--
Robbe Morris - 2004-2006 Microsoft MVP C#
I've mapped the database to .NET class properties and methods to
implement an multi-layered object oriented environment for your
data access layer. Thus, you should rarely ever have to type the words
SqlCommand, SqlDataAdapter, or SqlConnection again.
http://www.eggheadcafe.com/articles/adonet_source_code_generator.asp





Hello Gurus,

After loading my treeview control in windows form, how to i scroll to
the top and select the 1st node?

Any help is greatly appreciated
 
H

hgirma

wow, this was silly, i was using the code between BeingUpdate() and
EndUpdate() .. :)
sorry! thanks for the help tough!!

Hello,
that was my 1st attempt as well, but it did not work, it's selected(not
visible), but my tree is at the bottom still. When the tree gets
populated, the scroller grows and once it's done, it's at the bottom of
the tree :(

thanks for the suggestion!
tv.SelectedNode = tv.Nodes[0];

--
Robbe Morris - 2004-2006 Microsoft MVP C#
I've mapped the database to .NET class properties and methods to
implement an multi-layered object oriented environment for your
data access layer. Thus, you should rarely ever have to type the words
SqlCommand, SqlDataAdapter, or SqlConnection again.
http://www.eggheadcafe.com/articles/adonet_source_code_generator.asp





Hello Gurus,

After loading my treeview control in windows form, how to i scroll to
the top and select the 1st node?

Any help is greatly appreciated
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top