"Add New Folder" button in "Folder Browser" for Win 98
hello,
i searched the forum but the NewDialog style of BrowseFolder API doesn't work for 98.
i believe that user need to make its own dialog system for that purpose. but i am unable to use TreeView control properly. could someone please explain it to me.
plus how can i Add and delete folders (in general coding and in treeview also).
Re: "Add New Folder" button in "Folder Browser" for Win 98
Originally Posted by Harsh Gupta
thank you Hack. but there are few questions:
- it's only listing C: and not others like D:, E:, F: etc
- when i tried to click "Fill Up!", it showed an error
What was the error? It doesn't error when I run it.
Originally Posted by Harsh Gupta
- it takes some time in listing folders, why so?
Because of the number of folders you have on your PC. That routine takes about 20 minutes to finish if I run it on mine (I have over 200 folders just under \Source Code\VB6 )
Originally Posted by Harsh Gupta
- how can i show it like the pic you posted in the other thread?
You would need to add an image control, some icons that you want to represent folders and link the image control to the treeview.
Originally Posted by Harsh Gupta
- the cancel button is not working.
Yeah, I've never really liked the way he did the cancel thing. I would put a specific cancel button on the form and in its click event set bCancel to True.
Re: "Add New Folder" button in "Folder Browser" for Win 98
Originally Posted by Hack
This is the difference. This is the BIG difference.
SP5 contains a variety of patches and updates/grades to many of the VB controls with TreeView and ListView being two of them.
I would suggest you download that service pack and apply it.
all right. i will do it soon and revert back to you.
but it will take some time since i am using telephone connection nowadays and it will take few days, for me to download that huge package, plus IE, plus MDAC : PHEW :
Re: "Add New Folder" button in "Folder Browser" for Win 98
Originally Posted by Harsh Gupta
couled you please elaborate on this one.
The reason you are installing the service pack is because you don't have a VB service pack installed and the VB controls you are using are way out of date. This is why the treeview code worked on my machine but not on yours. One of the things these service packs do it provide updates for many of the VB6 controls.
Re: "Add New Folder" button in "Folder Browser" for Win 98
Btw I had completely forgotten about this fully featured browse dialog I've just found in the folder where I keep the cool stuff. It works great even under W98.
Lottery is a tax on people who are bad at maths
If only mosquitoes sucked fat instead of blood...
To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)
Re: "Add New Folder" button in "Folder Browser" for Win 98
Originally Posted by Harsh Gupta
all right Hack, i downloaded and installed VB SP6, but not much help and same problem i mentioned before. now what could be the problem?
Good question. As you know, it works on my machine, and now that you have yours updated, it should be working on yours.
Code that doesn't work, won't work anywhere, so if it works in one place, it should work in another. However, since it isn't, then we still have some kind of difference in our VB platforms. Are you using the form that I attached that I developed on my PC and works on my PC?
Re: "Add New Folder" button in "Folder Browser" for Win 98
You'll get the error simply because you have two folders with the same name, since you use the folder name (instead of full path) as the Key. Just make sure the Key is unique.
Re: "Add New Folder" button in "Folder Browser" for Win 98
Originally Posted by Hack
Good question. As you know, it works on my machine, and now that you have yours updated, it should be working on yours.
Code that doesn't work, won't work anywhere, so if it works in one place, it should work in another. However, since it isn't, then we still have some kind of difference in our VB platforms. Are you using the form that I attached that I developed on my PC and works on my PC?
yes, i also tried using the form you attached before (except that you used a picturebox instead of a treeview ) and the same thing/error occurred.
and thats not all. even after updation, i am not able to run this code posted by Moeur. please see the entire thread and you will see that the project posted by worked on Moeur's PC and not mine (even after updation).
Re: "Add New Folder" button in "Folder Browser" for Win 98
my request to you both, *SLAP ME*.
you are right JA. now all i want to learn is, how to make it look like a normal Browse for folder Dialog box (starting from desktop to all drives etc).
-icons can be set using imagelist.
-folders can be added using .Nodes.Add method.
Re: "Add New Folder" button in "Folder Browser" for Win 98
Originally Posted by Hack
Did you try Casey's code example?
which Casey's code??
Have you sorta, kinda, got it working? (That is what I'm picking up anyway )
yep it was my mistake.
but now, only one query left, how can i make it look like normal Browse for folder dialog box? mean how can i start it from Desktop and also show all the drives of the PC?
i can manage other things like Imagelist thing, and adding folders etc. though i may take a lot of time on it because i never did any work on these 2 (imagelist and treeview), but i want to do it myself.
but if you or somebody else may help me out regarding the display of all drives and starting from desktop thing.
Re: "Add New Folder" button in "Folder Browser" for Win 98
Originally Posted by Harsh Gupta
oh so sorry, i could not see your name there. i apologize.
but i think i need to add reference for it because it generates an error for
VB Code:
Dim sh As New Shell32.Shell
Dim str1 As Shell32.Folder2
if you can please tell me as i am not able to recall it.
thank you.
This is it.
Lottery is a tax on people who are bad at maths
If only mosquitoes sucked fat instead of blood...
To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)
Re: "Add New Folder" button in "Folder Browser" for Win 98
Maybe its a 98 thing, did you copy and paste the code ?, if you did try typing it out to see if the property or method is there and if not is there an alternative to grab the path.
Re: "Add New Folder" button in "Folder Browser" for Win 98
Originally Posted by vbasicgirl
Maybe its a 98 thing, did you copy and paste the code ?, if you did try typing it out to see if the property or method is there and if not is there an alternative to grab the path.
casey.
actually i changed your code a little bit. i changed "Shell32.Folder2" to "Shell32.Folder" because if i use "Shell32.Folder2" then on clicking "yes" on dialog box it returns an error 13 : "type mismatch" and highlights
VB Code:
Set str1 = sh.BrowseForFolder(Me.hWnd, "Select a Folder", 0, ssfDRIVES)
and if i use ".Folder" tehn .Self thing is not available.
EDIT: was that code running on your machine??
Last edited by Harsh Gupta; Jan 1st, 2006 at 01:24 PM.
Re: "Add New Folder" button in "Folder Browser" for Win 98
Originally Posted by litlewiki
try out karl e stevensons home page he's got loads of codes .may be it can help you k.e.s
litlewiki,
he is Karl E. Peterson and not Stevenson. and sorry, i couldnot find any such utility there. but probably take a much better and deeper look at the link later. thank you anyways.