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

Strange Behavior of treeview scrollbar

Hi,

Below is a simple program that demonstrates my poblem.
i fill a treeview with nine nodes. Then the treeview is shown with a
scrollbar. But I can't scroll to the last item. scrolling to the bottom
the last item remains almost nvisable.
What is the matter?

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace TrewViewTest
{
public partial class Form1 : Form
{
private System.Windows.Forms.TreeView treeView1;
public Form1()
{
InitializeComponent();
}
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
for (int i = 0; i < 10; i++)
{
//treeView1.Nodes.Add(new TreeNode(i.ToString()));
treeView1.Nodes.Add(i.ToString());
}
}
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(fals e);
Application.Run(new Form1());
}
private void InitializeComponent()
{
this.treeView1 = new System.Windows.Forms.TreeView();
this.SuspendLayout();
//
// treeView1
//
this.treeView1.Anchor =
((System.Windows.Forms.AnchorStyles)((((System.Win dows.Forms.AnchorStyles.Top
| System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.treeView1.Location = new System.Drawing.Point(13, 13);
this.treeView1.Name = "treeView1";
this.treeView1.Size = new System.Drawing.Size(267, 120);
this.treeView1.TabIndex = 0;
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(292, 266);
this.Controls.Add(this.treeView1);
this.Name = "Form1";
this.Text = "Form1";
this.ResumeLayout(false);
}
}
}
Sep 20 '06 #1
0 1466

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

Similar topics

0
by: sonali_reddy123 | last post by:
Hi, I am having a problem regarding use of a treeview. The problem is whether it is possible to set a default position to the scrollbar so that if any of the treenode contains the text bigger...
2
by: Michael C# | last post by:
Hi all, I need a treeview with the vertical scrollbar on the left-hand side of the control. Can someone point me in the right direction for the best way to do this? Articles, source code,...
0
by: rh | last post by:
Hi, I have a WinForm with a TreeView and a custom scrollbar control that is positioned over (hides) the TreeView's own default ScrollBar. I use SetScrollInfo to update the TreeView's default...
5
by: rh | last post by:
I created a user control that is made up of a TreeView and a VScrollBar. I set the TreeView.FullRowSelect = True and it works as expected (full row is visible, appears on top of everything else)...
4
by: solex | last post by:
Hello, I am in the process of converting a project from VB6 to DotNet and have noticed that some strange behavior with the TreeView Control (1) when setting the NodeFont property to Bold I...
0
by: Gene Hubert | last post by:
I've got two treeviews side by side on a panel on a form. They each have about 20 nodes in them. The treeview on the right has a vertical scrollbar. The treeview on the left needs a vertical...
2
by: Benny Raymond | last post by:
Does anyone know what causes a treeview to sometimes start with a horizontal scrollbar that has no reason to be there, and will not go away until you size into the nodes and then back out? ...
1
by: bill | last post by:
I am using VS 2005 (VB.NET) web forms. I have a webforms Master page, using a header and left side template. I have a content form with a ASP 2 treeview control in the content placeholder on...
0
by: bipi | last post by:
Now, I have treeview with Scrollbar properties is true, it mean that I will have two scroll (vertical scrollbar and horizontal scrollbar) . So, I don't want to use horizontal scrollbar, I want to...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
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...

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.