Jump to content
Xtreme .Net Talk

Recommended Posts

Posted (edited)

Hi again :)

 

I've spent too much time reading around for information on this, and trying for myself.. I know it's probably something obvious that I'm not going to find..

 

I have a TreeView that scrolls vertically due to the amount of nodes, but *dosen't* scroll horizontally as there are no nodes wide enough to need it.

 

However as a part of my app I have to set TreeView.Scrollable = false;, and later on, back to = true;. When Scrollable = true again, there's a vertical and horizontal scrollbar. None of the nodes have changed, they're all still far from needing horizontal scrolling. It seems that setting the .Scrollable property to true at runtime just automatically adds both scrollbars.

 

As a side not, the horizontal scrollbar won't even actually scroll. Just to show how pointless it is that it even appears :)

 

Is it possible to get rid of the horizontal, and leave the vertical one there? I can't see any properties for this, but I'm hoping there's something...

 

Thanks for any info guys ;)

 

[EDIT @ 19th July, 21:30]

I've still not found anything on this unfortunately, however my problem is solved as I've found an alternative way of doing it...

 

I'm still interested to see if this is possible though, if anyone knows.

Edited by 3xodus

Using: Visual Studio 2005/08

Languages: C#, Win32 C++, Java, PHP

  • *Experts*
Posted
Did you account for the width of the vertical scroll bar in the sizing of the treeview width? I think the Windows default widths are 16 for Win 2K and 17 for XP.

Member, in good standing, of the elite fraternity of mentally challenged programmers.

 

Dolphins Software

Posted (edited)

Thanks for your thoughts, though my treeview is more than wide enough. The treeview's width is 197, much wider than any of the nodes. I've tested with nodes 1 character in length, and the result is the same.

 

I am now fairly sure that setting the .Scrollable property to true at runtime just adds both scrollbars regardless of the contents of the treeview. Since I'm using C# 2005 beta 2, I'm hoping that the option is added in the final release to choose scrollbars (maybe boolean treeView.HScrollable and treeView.VScrollable) though it's not such a big deal.

Edited by 3xodus

Using: Visual Studio 2005/08

Languages: C#, Win32 C++, Java, PHP

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...