473,226 Members | 1,639 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,226 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 4879
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...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...

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.