473,854 Members | 1,769 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 4916
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 = FormStartPositi on.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.BackColo r = Color.Lime;

Panel panel2 = new Panel();

panel2.Parent = panel;

panel2.Dock = DockStyle.Fill;

panel2.BackColo r = 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.BackColo r = Color.Tan;

panel1.Width = ClientSize.Widt h / 3;

panel3.Height = ClientSize.Heig ht / 3;

#endregion
#region Statusleiste einstellen
sb = new ProgressStatusB ar();

sb.Parent = this;

sb.ShowPanels = true;

sb.SizingGrip = true;

sb.Dock = DockStyle.Botto m;
// -Pannels erstellen

// -Hilfe Panel

sbpHelp = new StatusBarPanel( );

sbpHelp.Text = "Bereit";

sbpHelp.AutoSiz e = StatusBarPanelA utoSize.Spring;

// -ProgressPanel

sbpProgress = new ProgressPanel() ;

sbpProgress.Wid th = 100;

sbpProgress.Max imum = 100;

sbpProgress.Min imum = 0;

sbpProgress.Val ue = 50;

sbpProgress.Too lTipText = "Fortschrit t in Prozent";

// -GoStopPanel

sbpGoStop = new StatusBarPanel( );

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

sbpGoStop.ToolT ipText = "GO";

sbpGoStop.Width = 35;

sbpGoStop.Borde rStyle = StatusBarPanelB orderStyle.None ;

sb.Panels.AddRa nge(new StatusBarPanel[]{sbpHelp,sbpPro gress,sbpGoStop });
#endregion

#region Menuleiste einstellen

Menu = new MainMenu();

EventHandler ehSelect = new EventHandler(On MenuSelect);

EventHandler ehClick = new EventHandler(On MenuClick);
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.ImageSi ze = new Size(32,32);

imglist.Images. AddStrip(bm);

imglist.Transpa rentColor = Color.Magenta;

ToolBar tbar = new ToolBar();

tbar.Parent = this;

tbar.ImageList = imglist;

tbar.Appearance = ToolBarAppearan ce.Flat;

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

{

ToolBarButton tbarbtn = new ToolBarButton() ;
tbarbtn.ImageIn dex = i;

tbar.Buttons.Ad d(tbarbtn);

}

#endregion

treeView1 = new TreeView();

treeView1.Paren t = panel1;

treeView1.Dock = DockStyle.Fill;

dataGrid1 = new DataGrid();

dataGrid1.Paren t = panel3;

dataGrid1.Dock = DockStyle.Fill;


string connString = @"Provider=Micr osoft.JET.OLEDB .4.0;data
source=C:\plcse tup.mdb";

string sqlString = "SELECT * FROM plc_parameter";

OleDbConnection connection = new OleDbConnection (connString);

OleDbDataAdapte r dataAdapter = new OleDbDataAdapte r(sqlString, connection);

DataSet dataSet = new DataSet();

dataAdapter.Fil l(dataSet, "plc_parameter" );

dataGrid1.DataS ource = dataSet.Tables["plc_parame ter"].DefaultView;

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

listBox1.Parent = panel2;

listBox1.Dock = DockStyle.Fill;

listBox1.Integr alHeight = 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
2190
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 am able to check using xpath in asp.net 2.0 till MenuItem node. if i check visible attribute value till SubMenuLevel0 node then in tree it will not display the MenuItem Node at all Note: My tree Menu will start from MenuItem node and it will...
5
3698
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 think of, but just can't get it to display quite right. It's worth noting that the page displays exactly as intended in Firefox. First Problem:
1
15478
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 save viewstate during the previous request. For example, when adding controls dynamically,
10
2538
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 for ASP.NET however most of them are already compiled and don't come with source code. I am really just looking for an example on how to create my own Tree Control. Thanks a bunch.
5
1744
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) +313 System.Web.UI.Control.BuildProfileTree(String parentId, Boolean calcViewState) +201 System.Web.UI.Control.BuildProfileTree(String parentId, Boolean calcViewState) +263
3
1271
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 tool bar and menu and it works fine extending the "handles" property inherent within .net.
4
2445
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. Should i need to do any thing for the obout tree view configuration.
1
1673
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
1624
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 property or i have to do anythinf else ? thanks
0
9899
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9750
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10740
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9510
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7909
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5738
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4550
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4149
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3182
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.