Page 1 of 2
Explorer-TreeView in VB.NET
Posted: 28 Nov 2017, 21:59
by WoF
Hello TiKu,
it's been long time we last talked. I hope you are still up and about, still feeling well and still supporting this forum. It was always nice to discuss stuff with you.
After this long years, where your TreeView has worked successfully and reliably in my old project, I got a new one, where the simple task is, to pick a path from the file system with your Explorer-Treeview. The difference here being: it is not VB6 anymore but VB.NET. I work currently with the VS.NET 2008 Express.
I reduced the problem to the most simple project: a Form and on it your TreeView. I got the latest version from your site. When running, it shows properly the Tree according to specs set in the options. (I want it only to show File-System-Objects, like drives and Folders).
But when clicking on it or on an item, the events do not seem to fire. I simply put a msgbox in the ClickEvent and one in the ItemClick event, but none of them seem to fire.
It seems I'm doing something essential false here. What is it.
Re: Explorer-TreeView in VB.NET
Posted: 29 Nov 2017, 19:19
by WoF
Oh, and although I have addresssed Tiku personally, I'd appreciate and value everybody else's Input on that behalf. Anybody who knows why the events do not fire under VB.NET, pls help me.
Re: Explorer-TreeView in VB.NET
Posted: 01 Dec 2017, 00:34
by TiKu
Hi,
To be honest I've never tested with VB.NET. I've created a System Windows Forms test project with VB.NET 2010 and dragged the control onto the Form. When starting the application, it throws an exception that it is missing Interop.VBRUN 6.0.0.0 or a dependency. Seems like some project config is wrong. Can you help me so I can try to help you?
Regards
TiKu
Re: Explorer-TreeView in VB.NET
Posted: 01 Dec 2017, 00:43
by TiKu
Nevermind, I've found it myself: You need to set "Embed Interop Types" to False for the references to MSDATASRC, stdole, VBRUN and so on.
Well, the Click event works for me:
Code: Select all
Public Class Form1
Private Sub AxExplorerTreeView1_ClickEvent(sender As System.Object, e As System.EventArgs) Handles AxExplorerTreeView1.ClickEvent
MessageBox.Show("bla")
End Sub
End Class
The control is completely in its default config. I've attached the sample project.
Re: Explorer-TreeView in VB.NET
Posted: 01 Dec 2017, 19:54
by WoF
Hey, thanks for your prompt late-night-reply. I had given up by then.
Good to talk to you again. Hope you are well.
I will try the sample on my computer and see if I get along.
We tried a similar thing just now on a friend's computer, where it worked also well. But I noticed that when the ItemClickEvent event fires (also the ClickEvent) , the path hasn't yet changed. That means when I click on another folder, the path shows still the previous folder. This is a little unfortunate, because when clicking a tree item (folder) I want to display its contents and not the contents of the previous folder. Can this behaviour be changed? Or am I supposed to use a different event for that purpose?
Re: Explorer-TreeView in VB.NET
Posted: 01 Dec 2017, 20:24
by WoF
Ok, it seems I couldn't run your project because it opened in VS2013 and then popped errors. I didn't even want to follow (because I do not like 2013 very much), so I did as per your suggestions:
First I installed 1.15.1 of your Explorer-Treeview.
Then I created a new project, added the reference and plopped the control on the form.
It worked immediately without errors. That's very good success so far.
I added a textbox to show the current path on events happening.
The effect is the same as I described. Only when I click on an item for the second time the proper path is displayed. That means the ClickEvent and ItemClickEvent occurs before the tree has changed its path. Which event do I have to use to get the proper path after the mouse click?
Re: Explorer-TreeView in VB.NET
Posted: 01 Dec 2017, 20:33
by WoF
Nevermind, sorry to have bothered you. I think I found out myself: The _SelChanged fires exactly when the path has changed, so that is rather what I need. Thanks again.
Say, you still working on these VB6 controls? Personally I still love VB6 and think it is such a fine and fast tool to make even complex applications. VB.NET is large, if not huge, heavy and clumsy and cumbersome (2013 even more than 2008. 2008 I slowly started to like).
Your TreeView is such a wonderful control and I wouldn't miss it, slowly processing over to the .NET-world.
Re: Explorer-TreeView in VB.NET
Posted: 02 Dec 2017, 01:57
by TiKu
Hi,
I'm fine, thanks. I want to reply to this part of your post:
WoF wrote: ↑01 Dec 2017, 20:33
Say, you still working on these VB6 controls? Personally I still love VB6 and think it is such a fine and fast tool to make even complex applications. VB.NET is large, if not huge, heavy and clumsy and cumbersome (2013 even more than 2008. 2008 I slowly started to like).
Your TreeView is such a wonderful control and I wouldn't miss it, slowly processing over to the .NET-world.
Well, ExplorerTreeView 1.x is dead. I have not been working on it for 3 years and its successor has been published like 9 years ago. The other controls are kind of resting since 1,5 years. Let me explain why.
Until Windows 7 Windows has been my favorite system. I enjoyed writing software for it. I really dislike Windows 8 and Windows 10. Linux has become my favorite system, also because at work I have been doing quite a lot with Linux during the last 3 years. Win32 seems to be dead for Microsoft. The .NET framework never attracted me sufficiently to use it for private projects.
So I've lost a lot of the motivation that kept me working on these controls for 15 years. My focus has moved to Android apps, modern web sites, cloud computing, and artifical intelligence. But it is not very likely that I'll publish private projects in these areas, because practically 100% of what I'm doing in these areas is for my job - there are very interesting and motivating projects.
For me, Windows does not play a big role anymore. Of course my computer in the office runs Windows and most of the time I'm working on a VB6/C# project there. But this is mainly for earning money. The things that motivate me nowadays have little to do with Windows or Microsoft.
Coming back to the controls... I have not yet decided what to do with them. From time to time I fix minor bugs that are being reported. I plan to publish the sourcecode on GitHub one day, but currently it still feels like giving away your baby, therefore I've not yet done it.
Best regards
TiKu
Re: Explorer-TreeView in VB.NET
Posted: 02 Dec 2017, 03:26
by WoF
I fully agree with your disliking of Windows 10. I never even touched Win 8 or 8.1 and I'm disgusted that they will discontinue Win 7 support. I have seen VB6 running under Win10, where you practically cannot use the form-designer anymore. It has become a little clumsy under win7 already, but under win10 it is not practicable anymore.
I have worked a little with Linux either, but have never come around to write programs under it. I read that there was a project called K-Basic, which was trying to implement VB6 under Linux but I never had the time to try it out. It is a german guy publishing it. Sounds interesting to me for the future.
Concerning your TreeViews: I saw that there was a 2.x but I noticed that you have to add the Explorer capability separately, so I stuck to 1.5x because I wanted quick results. I have not come around yet to study 2.x and its externally added Shell-Extension. Maybe it is even better than 1.5x.
What are you saying? You can really earn money by working on a VB6/C# project nowadays?
That's tempting.
Anyway, I understand, that you don't want to give away your babies. Did you write them in C++?
Re: Explorer-TreeView in VB.NET
Posted: 02 Dec 2017, 03:38
by WoF
You need to set "Embed Interop Types" to False for the references to MSDATASRC, stdole, VBRUN and so on.
How do you do that? Not that it has become necessary in my project yet currently, but that VBRUN popped up an error time and again in converted VB6 progs.
Kind regards
Wolfgang
Re: Explorer-TreeView in VB.NET
Posted: 02 Dec 2017, 10:30
by TiKu
WoF wrote: ↑02 Dec 2017, 03:26
I fully agree with your disliking of Windows 10. I never even touched Win 8 or 8.1 and I'm disgusted that they will discontinue Win 7 support. I have seen VB6 running under Win10, where you practically cannot use the form-designer anymore. It has become a little clumsy under win7 already, but under win10 it is not practicable anymore.
We use Windows 10 at work. I don't need the Form designer very often, so out of my head I cannot tell you whether it works well.
With Windows 10 I feel like a tolerated guest and not like the owner of the system. This is annoying.
WoF wrote: ↑02 Dec 2017, 03:26I have worked a little with Linux either, but have never come around to write programs under it. I read that there was a project called K-Basic, which was trying to implement VB6 under Linux but I never had the time to try it out. It is a german guy publishing it. Sounds interesting to me for the future.
Well, I prefer languages that look more like C. VB6 was great for learning and somehow I still like its simplicity, but I'm not really a fan of its syntax.
WoF wrote: ↑02 Dec 2017, 03:26Concerning your TreeViews: I saw that there was a 2.x but I noticed that you have to add the Explorer capability separately, so I stuck to 1.5x because I wanted quick results. I have not come around yet to study 2.x and its externally added Shell-Extension. Maybe it is even better than 1.5x.
Using version 2 would require that you rewrite quite some code. It follows a more generic concept. This makes it more powerful, but also a bit more difficult to use in the beginning. I suggest you have a look at the samples and the features and play around with it.
WoF wrote: ↑02 Dec 2017, 03:26What are you saying? You can really earn money by working on a VB6/C# project nowadays?
That's tempting.
Actually we have big problems to find good VB6 developers, because they usually are already quite old or are not professional/skilled enough or both. So if you are a good developer, know the new stuff, but also are skilled in VB6, you can earn quite some money.
WoF wrote: ↑02 Dec 2017, 03:26Anyway, I understand, that you don't want to give away your babies. Did you write them in C++?
ExplorerTreeView 1.x and Flatbutton have been written in VB6. The other controls have been written in C++.
Regards
TiKu
Re: Explorer-TreeView in VB.NET
Posted: 02 Dec 2017, 10:36
by TiKu
WoF wrote: ↑02 Dec 2017, 03:38
You need to set "Embed Interop Types" to False for the references to MSDATASRC, stdole, VBRUN and so on.
How do you do that? Not that it has become necessary in my project yet currently, but that VBRUN popped up an error time and again in converted VB6 progs.
Make sure that you see all files in the Solution Explorer. Then go to References, single-click each reference, open its properties and set the "Embed Interop Types" to False.
Re: Explorer-TreeView in VB.NET
Posted: 02 Dec 2017, 19:27
by WoF
When I click on one of the Reference items, the properties are shown in the properties window below, but the "Embed Interop Types" does not appear there. Only 2 properties of 10 are available for change. They are "Copy Local" (true) and "Isolated" (false) for VBRUN.
I am using VS2008 currently.
Re: Explorer-TreeView in VB.NET
Posted: 02 Dec 2017, 23:50
by TiKu
WoF wrote: ↑02 Dec 2017, 19:27
I am using VS2008 currently.
Maybe this is a feature of VS 2010 and above.
Re: Explorer-TreeView in VB.NET
Posted: 03 Dec 2017, 17:01
by deservengg
Dear Tiku,
Unfortunately what you mentioned about 2010 about this "Embed Interop Types" is not at all available in 2008-2010- 2013.
Can I ask you where are you getting this, this is becoming interesting now to me.
It is not there really anywhere in all the aforementioned versions.
you replied to Mr.WoF "Maybe this is a feature of VS 2010 and above."
but this seems ambiguous.
Regards
Deserve.