473,396 Members | 1,865 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.

WinForms TreeView Display positioning

I have a TreeView (System.Windows.Forms.TreeView) control on a custom control (similar to the Output window in visual studio 2013). that control is placed at the bottom of a main form (like the visual studio ide). when i populate this TreeView control with data, it fills correctly, but, if the containing control is close to the bottom, the displayed "popup" is cut off. if i expand the lower control to have more room, the control displays with all the data. the display is "docked" to where it was designed. i tried putting a scrollbar on the display (which worked), but this is not the desired/requested behavior.

what i would like to do is to either have the display "go up", if necessary, like the "Show output from:" display on the Output window in Visual Studio 2013, or, simply have the display be FreeFloating.

note: this is an existing Winforms application and this is an enhancement request.

any suggestions would be greatly appreciated.

thanks in advance.

pete.
Feb 2 '16 #1
1 1482
RESOLVED:
- create 3 new variables ... originalParent, originalLocation, and firstTime.
- in the Resize method (which is called from a mouseOver event), where the size of the display is set, if this is the first time, save off the above and set the parent to the TopLevelControl
- determine the new location on the form ... originalParent.FindForm().PointToClient(originalPa rent.PointToScreen(originalLocation).
- see if the displayed output would go beyond the end of the top form ... TopLevelControl.DisplayRectangle.Height - (locationOnForm.Y + oTreeView.DisplayRectangle.Height)
- if the difference is less than 0, adjust the new location.Y by the difference.
- set the display output Location to the new location

presto ...

- also, added a method so that when the main form is resized, or the containing control is repositioned, the location is set using the info above - just not adjusting for the display output height.
- add a call to the reset in the mouseLeave event
Feb 4 '16 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

42
by: lauren quantrell | last post by:
So many postings on not to use the treeview control, but nothing recently. Is it safe to swim there yet with Access 2000-Access 2003?
3
by: Hazz | last post by:
I am just beginning to design a Treeview display (winforms) for wine regions. Problem. Some wine growing regions belong to two counties. Eg. Carneros is in both Napa and Sonoma Counties. Although...
1
by: Chris | last post by:
Hi everyone, I am trying to build a treeview dynamically with codes rather than with xml files that I have used in the past. I seem to be having a problem with the tree's display when it is...
4
by: Hazz | last post by:
I am using the Winforms Treeview right out of the toolbox with all the default settings. It looks very boring. What can I do to dress it up and make it look at least kind of cool? I remember...
0
by: Andrew Ducker | last post by:
Nodes display as whitespace when scrollable is set to false, and more nodes are cleared and recreated than will fit into the space available. Steps to replicate: Create a form, with a button...
2
by: adh | last post by:
Hi, How can I replace just the icon of 1 single node, without repainting the whole tree? (Eliminating Screen Flickering?) Thanks, adh *** Sent via Developersdex http://www.developersdex.com...
4
by: Karl Rhodes | last post by:
Hi all... Perhaps I'm not going about this the right way, but I wondered if anyone can help? I have a treeview which populates from a datatable using a parent/ child relationship. It stores a...
4
by: frostbb | last post by:
I have a C# WinForms treeview with 20 or so 'level 0' nodes. My users will normally have 2 of the 'level 0' branches open down to a '5th level' selected node. The users will make updates to...
5
by: Peter Duniho | last post by:
On Sat, 27 Sep 2008 12:02:04 -0700, <timor.super@gmail.comwrote: You don't, not when you don't know that one event is necessarily going to follow another. If the events can appear alone, then...
1
by: renuami | last post by:
Hello Please advise .... I do not know in which section i should be posting Winforms Questions. There is not Option. So i am posting it here... apologize for any inconvinence..... This is...
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: 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:
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
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
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...
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.