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

Horiz scroll error in tree view

Hi,

I have docked a tree view to the left on a form. When I
start to populate this tree view with nodes, a horizontal
scroll box appears in the bottom of the tree view even
though thee tree view is big largely big enough to fit
the nodes and text. If I widen the tree view the scroll
bar doesn't resize itself to show the relative view size
in relation to the total size. Only if I narrow the view
to not fit the nodes, the scroll box starts to behave as
expected - and disappears when all nodes fits within the
tree view. Is this a bug, can I make a work around - It
doesn't look nice.

best regards Jesper.
Nov 15 '05 #1
1 4886
I have a outlook like GUI.

On the left a treeview and on the right a datagrid.
Seperated by a splitterbar. I dont have such a behavior like you describe.
I did not used the designer, i used 3 panel Controls to do that.

I guess the dockstyle is the problem. I use dockstyle.fill

Regard

Michael

Code snipped:

public Form1()

{

#region Form1 einstellen

Icon = new Icon(GetType(), "Key.ico");

Text = "PLCSetup";

Size = new Size(640,480);

StartPosition = FormStartPosition.CenterScreen;

MinimumSize = new Size(400,150);

#endregion
#region Form1 zwei mal Splitten einstellen

Panel panel = new Panel();

panel.Parent = this;

panel.Dock = DockStyle.Fill;

Splitter split1 = new Splitter();

split1.Parent = this;

split1.Dock = DockStyle.Left;

Panel panel1 = new Panel();

panel1.Parent = this;

panel1.Dock = DockStyle.Left;

panel1.BackColor = Color.Lime;

Panel panel2 = new Panel();

panel2.Parent = panel;

panel2.Dock = DockStyle.Fill;

panel2.BackColor = Color.Blue;

Splitter split2 = new Splitter();

split2.Parent = panel;

split2.Dock = DockStyle.Top;

Panel panel3 = new Panel();

panel3.Parent = panel;

panel3.Dock = DockStyle.Top;

panel3.BackColor = Color.Tan;

panel1.Width = ClientSize.Width / 3;

panel3.Height = ClientSize.Height / 3;

#endregion
#region Statusleiste einstellen
sb = new ProgressStatusBar();

sb.Parent = this;

sb.ShowPanels = true;

sb.SizingGrip = true;

sb.Dock = DockStyle.Bottom;
// -Pannels erstellen

// -Hilfe Panel

sbpHelp = new StatusBarPanel();

sbpHelp.Text = "Bereit";

sbpHelp.AutoSize = StatusBarPanelAutoSize.Spring;

// -ProgressPanel

sbpProgress = new ProgressPanel();

sbpProgress.Width = 100;

sbpProgress.Maximum = 100;

sbpProgress.Minimum = 0;

sbpProgress.Value = 50;

sbpProgress.ToolTipText = "Fortschritt in Prozent";

// -GoStopPanel

sbpGoStop = new StatusBarPanel();

sbpGoStop.Icon = new Icon(GetType(), "Green.ico");

sbpGoStop.ToolTipText = "GO";

sbpGoStop.Width = 35;

sbpGoStop.BorderStyle = StatusBarPanelBorderStyle.None;

sb.Panels.AddRange(new StatusBarPanel[]{sbpHelp,sbpProgress,sbpGoStop});
#endregion

#region Menuleiste einstellen

Menu = new MainMenu();

EventHandler ehSelect = new EventHandler(OnMenuSelect);

EventHandler ehClick = new EventHandler(OnMenuClick);
MenuItem mi = new MenuItem("Datei");

mi.Select += ehSelect;

Menu.MenuItems.Add(mi);

mi = new MenuItem("Ende");

mi.Select += ehSelect;

mi.Click += ehClick;

Menu.MenuItems[0].MenuItems.Add(mi);

#endregion

#region Buttonleiste einstellen

bm = new Bitmap(GetType(), "ToolBar1.bmp");

ImageList imglist = new ImageList();

//Size size = new Size(32,32)

imglist.ImageSize = new Size(32,32);

imglist.Images.AddStrip(bm);

imglist.TransparentColor = Color.Magenta;

ToolBar tbar = new ToolBar();

tbar.Parent = this;

tbar.ImageList = imglist;

tbar.Appearance = ToolBarAppearance.Flat;

for(int i = 0; i < 8; i++)

{

ToolBarButton tbarbtn = new ToolBarButton();
tbarbtn.ImageIndex = i;

tbar.Buttons.Add(tbarbtn);

}

#endregion

treeView1 = new TreeView();

treeView1.Parent = panel1;

treeView1.Dock = DockStyle.Fill;

dataGrid1 = new DataGrid();

dataGrid1.Parent = panel3;

dataGrid1.Dock = DockStyle.Fill;


string connString = @"Provider=Microsoft.JET.OLEDB.4.0;data
source=C:\plcsetup.mdb";

string sqlString = "SELECT * FROM plc_parameter";

OleDbConnection connection = new OleDbConnection(connString);

OleDbDataAdapter dataAdapter = new OleDbDataAdapter(sqlString, connection);

DataSet dataSet = new DataSet();

dataAdapter.Fill(dataSet, "plc_parameter");

dataGrid1.DataSource = dataSet.Tables["plc_parameter"].DefaultView;

//dataGrid1.Text
listBox1 = new ListBox();

listBox1.Parent = panel2;

listBox1.Dock = DockStyle.Fill;

listBox1.IntegralHeight = false;

"Jesper DK" <je****@hotmail.com> schrieb im Newsbeitrag
news:09****************************@phx.gbl...
Hi,

I have docked a tree view to the left on a form. When I
start to populate this tree view with nodes, a horizontal
scroll box appears in the bottom of the tree view even
though thee tree view is big largely big enough to fit
the nodes and text. If I widen the tree view the scroll
bar doesn't resize itself to show the relative view size
in relation to the total size. Only if I narrow the view
to not fit the nodes, the scroll box starts to behave as
expected - and disappears when all nodes fits within the
tree view. Is this a bug, can I make a work around - It
doesn't look nice.

best regards Jesper.

Nov 15 '05 #2

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

Similar topics

0
by: Tree menu using XML | last post by:
I have one XML file that has nodes and sub node and each and every node has the attribute call visible if its value is true then diplay this node else don't display thid node, but this condition i...
5
by: Aidan | last post by:
Greetings all, I'm trying to build a div based layout for a mambo template (work in progress), and I'm having a strange problem, 2 acctually, with scroll bars in IE. I've tried everything I can...
1
by: Michael | last post by:
Hi, Any one know the problem of the following error: Thanks, m Failed to load viewstate. The control tree into which viewstate is being loaded must match the control tree that was used to...
10
by: dwok | last post by:
Does anyone know of a good article that discusses creating a "Tree View" control in ASP.NET? Or perhaps a Tree View Control that comes with source code? I have come across a lot of tree controls...
5
by: Nathan Sokalski | last post by:
When I view my index.aspx page any time after the first time, I recieve the following error: System.Web.TraceContext.AddNewControl(String id, String parentId, String type, Int32 viewStateSize)...
3
by: Adam Honek | last post by:
Hi, I have the code below that I'm using in a tree view to detect what node the user has clicked on. It compiles but on runtime I get a type cast error. I've used this method for both the...
4
by: contactme.navin | last post by:
Hi, I have problem in displaying the treeview in my asp pages. I had used the obout.com tree view to display the tree navigation in the webpages. Following is the error i got in the page....
1
by: jimdxz | last post by:
I was wondering how you'd scroll to a node in a treeview if and only if it is out of view. I used scrollIntoView() but it scrolls to the node whether it's in the view or not.
2
by: philippe.kozubek | last post by:
hello, I build a tree view in a ASPx page but when i expand my nodes i cant see all of it, the control doest put any scroll bar so i can scroll to see my complete tree view data.... is there any...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
0
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,...

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.