View Full Version : [c#]Anyone able to get this working?
Zeph
December 26th, 2013, 11:25 AM
http://www.codeproject.com/Articles/23746/TreeView-with-Columns
Tried to throw this control into one of my forms and it threw an exception the moment I tried to resize it. Says I can't resize it because the size must be between the minimum and max size, but when I try updating those it just tells me that I can't adjust them.
Btcc22
December 26th, 2013, 01:07 PM
Post code!
Syuusuke
December 26th, 2013, 01:23 PM
There's not much code associated, he basically dragged and dropped a TreeListView onto his form and resizing gives him an exception error. I downloaded it and it happened to me too.
I can try to debug recompile the control for ya, if I can fix it... or you can use alternate one if possible =)
Zeph
December 26th, 2013, 02:37 PM
If you want to take the time to do that, it would be amazing. I'm not too big of a fan with c# after digging into it. At first, all the shiny .net stuff looked amazing, but by now I've spent about as much time trying to redesign things because c# does a lot of things far differently than c/cpp (if at all).
The column tree view thing is the shiny I assumed would be easily accessible. Yeah, I wasn't that happy when I had my nodes and went to get things in columns. Would have spent a lot more time learning the forms side of cpp, but I guess I wouldn't have run into this problem in the long run >_<.
Definitely need to learn how to write controls from scratch to get nifty things like this.
Btcc22
December 26th, 2013, 02:47 PM
TreeListView.cs, line 308:
if ((value >= 0 && value <= max) && (value != m_vScroll.Value))
to
if ((value >= m_vScroll.Minimum && value <= m_vScroll.Maximum) && (value != m_vScroll.Value))
TreeListView.cs, line 625:
return (ClientRectangle.Height - Columns.Options.HeaderHeight) / RowOptions.ItemHeight ;
to
int visible = (ClientRectangle.Height - Columns.Options.HeaderHeight) / RowOptions.ItemHeight;
return visible > 0 ? visible : 0;
You can delete this bit:
if (value < 0)
value = 0;
int max = m_vScroll.Maximum - m_vScroll.LargeChange + 1;
if (value > max)
value = max;
Disclaimer: I don't 'do' C# and I didn't go through the code; just made the changes that seemed logical and fixed the crashes. No guarantees offered.
Would have spent a lot more time learning the forms side of cpp, but I guess I wouldn't have run into this problem in the long run >_<.
Definitely need to learn how to write controls from scratch to get nifty things like this.
Use something like Qt (http://qt-project.org/) for GUIs in C++ (and other languages, I guess). It's cross-platform and pretty easy to get up and running. If you search your PC for common files used by Qt (say, QtCore4.dll), you'll probably be surprised at how many programs you use that use it for their GUIs.
Patrickssj6
December 26th, 2013, 09:21 PM
TreeListView.cs, line 308:
if ((value >= 0 && value <= max) && (value != m_vScroll.Value))
to
if ((value >= m_vScroll.Minimum && value <= m_vScroll.Maximum) && (value != m_vScroll.Value))
For that extra nanosecond of performance!11
if ((value != m_vScroll.Value) && (value >= m_vScroll.Minimum && value <= m_vScroll.Maximum))
Use something like Qt (http://qt-project.org/) for GUIs in C++ (and other languages, I guess). It's cross-platform and pretty easy to get up and running. If you search your PC for common files used by Qt (say, QtCore4.dll), you'll probably be surprised at how many programs you use that use it for their GUIs.
Just one :P MikTex. Still true though.
Zeph
December 27th, 2013, 10:54 AM
Disclaimer: I don't 'do' C# and I didn't go through the code; just made the changes that seemed logical and fixed the crashes. No guarantees offered.
Didn't fix it for me. Get an error about an object reference not set to instance of an object now. :\.
Btcc22
December 27th, 2013, 11:12 AM
Sounds like a problem elsewhere. I just downloaded the source code from the site.
Are you able to upload the code you're using? A zip attachment or something will do.
Zeph
December 27th, 2013, 12:32 PM
Ah, the folder was read only and wouldn't rebuild. It can be resized now.
Beyond that, I'm still getting problems when trying to use it. The tool is .Net 2.0 and the highest version you can get it to is .Net 3.0. Should I drop my project down to 3.0 it won't build because of some LINQ/XML stuff.
Here (http://www.modreality.net/ModaCommonTools.rar)'s the project.
Btcc22
December 27th, 2013, 05:11 PM
Do you have the project you're using the library in too? I can't find any fault with it when using the 'TreeTestApp'.
Zeph
December 29th, 2013, 05:31 AM
Just a new blank solution. I add it as an existing project and drag it into a blank form.
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.