It seems that you're using an outdated browser. Some things may not work as they should (or don't work at all).
We suggest you upgrade newer and better browser like: Chrome, Firefox, Internet Explorer or Opera

×
Good day to every single one of you,
Big surprise, I screwed yet something else up. I somewhat advanced in my studies of Visual Basic, but apparently its not good enough, since I require assistance. In my school we have assignment to make our version of Total Commander/File Manager, and I have trouble putting up together. I am not asking for someone to put it up together for me, because what would be the point of that? All I am asking is if there is someone here skilled in Visual Basic, who would be able to provide me with advice, answers to my questions and maybe even teach me things or two.

If I had some money I would held up a contest for GOG games or other, but unfortunately I don't have cash, so all I can offer is my gratitude and/or tons of copies of DOTA 2
I'd love to help, but I've never used VB in my whole life.
avatar
Detlik: ...
My experience is with VBA using Access and Excel so I doubt I would be much help. You might explain what your problem is or post the problem code??

Anyway, try this website for some VB code examples.
avatar
Detlik: ...
avatar
Stuff: My experience is with VBA using Access and Excel so I doubt I would be much help. You might explain what your problem is or post the problem code??

Anyway, try this website for some VB code examples.
There isn't problem with code as much I don't know how to do some things. I was experimenting with some code snippets and rewriting them and my program ended up being one big mess, so today I started from scratch (and some more knowledge) rewrote it using classes and such and one problem resolved (that is showed only system files and not others)

Thanks, I will check that and if I run into some specific problem with my code I will post it here.

Though there is one thing I could really use help with right now. The program is supposed to open a file, load all the text contents into TextBox and it should allow user to rewrite its contents and save them to the file.
Post edited February 07, 2013 by Detlik
Give this example a try or this one or this one.

Google "open text file "vb" for many other example of working with text files. There are many helpful sites for VB so Google [your problem | interest] followed or preceded by VB. I've been saved by code sites more times than I can count. . . =)
Post edited February 07, 2013 by Stuff
avatar
Detlik: Though there is one thing I could really use help with right now. The program is supposed to open a file, load all the text contents into TextBox and it should allow user to rewrite its contents and save them to the file.
I believe this YouTube tutorial gives a step-by-step to solve this problem. Young man seems to know what he is doing. =)
Could someone help me with search function? As in a text box where I would type name of the file and it would search all folders for it?
avatar
Detlik: Good day to every single one of you,
Big surprise, I screwed yet something else up. I somewhat advanced in my studies of Visual Basic, but apparently its not good enough, since I require assistance. In my school we have assignment to make our version of Total Commander/File Manager, and I have trouble putting up together. I am not asking for someone to put it up together for me, because what would be the point of that? All I am asking is if there is someone here skilled in Visual Basic, who would be able to provide me with advice, answers to my questions and maybe even teach me things or two.

If I had some money I would held up a contest for GOG games or other, but unfortunately I don't have cash, so all I can offer is my gratitude and/or tons of copies of DOTA 2
I can provide some help - I'm an Microsoft Certified Solution Developer in VB.NET and part of my day job is mentoring :-)

Just PM me if you need help.

James :-)
Any idea how to fix the fact that I can look within folders, but as long as there is another sub-folder within that folder the program keeps crashing? With "Missing String Member exception"
Maybe if you shared to section of code where the exception happens?
avatar
drennan: Maybe if you shared to section of code where the exception happens?
This section is in class :

Public Sub VSouboru(ByVal Diskator, ByVal Listboxator)
Dim dir As New DirectoryInfo(Diskator)
For Each subdir As DirectoryInfo In dir.GetDirectories()
VSouboru(subdir.FullName, Diskator)
Listboxator.Items.Add(subdir.FullName) -- where the exception occurs
Next
End Sub

This section is in main form :

Private Sub Listboxator_DoubleClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Listboxator.DoubleClick

Dim nacti As New Nacitani
Dim ulozeni As String
Cesta.Text = My.Computer.FileSystem.GetDirectoryInfo(Listboxator.SelectedItem).ToString
ulozeni = My.Computer.FileSystem.GetDirectoryInfo(Listboxator.SelectedItem).ToString
Listboxator.Items.Clear()
nacti.VSouboru(ulozeni, Listboxator)
End Sub


Listboxator = Listbox
Cesta = label
Diskator = Variable, that means path to the selected file
avatar
Detlik: *snip*
You're passing Diskator (a string) as the second parameter to VSouboru() in the recursive call inside VSouboru():

VSouboru(subdir.FullName, Diskator)

So the Listboxator argument will be a String and Listboxator.Items.Add() will fail because there's no such member of the String class.

I haven't touched any form of Basic in decades, so sorry if the above didn't make sense.
Post edited February 09, 2013 by drennan
avatar
Detlik: *snip*
avatar
drennan: You're passing Diskator (a string) as the second parameter to VSouboru() in the recursive call inside VSouboru():

VSouboru(subdir.FullName, Diskator)

So the Listboxator argument will be a String and Listboxator.Items.Add() will fail because there's no such member of the String class.

I haven't touched any form of Basic in decades, so sorry if the above didn't make sense.
I see. So because I am passing single string to the class, the other will automatically turn into class...so specify the types in Public Sub VSouboru(ByVal Diskator, ByVal Listboxator) ?
avatar
Detlik: I see. So because I am passing single string to the class, the other will automatically turn into class...so specify the types in Public Sub VSouboru(ByVal Diskator, ByVal Listboxator) ?
I'm not sure I understand what you mean by the first part, so I'll just outline what happened.

The order of parameters in a function call must be the same as the order you declared them in. The parameter list you declared was:
Public Sub VSouboru(ByVal Diskator, ByVal Listboxator)

The first argument you pass to VSouboru will be referred to by the name "Diskator" inside the function and the second one will be referred to by "Listboxator".

When you call VSouboru by VSouboru(subdir.FullName, Diskator), in the called function's scope Diskator (the first argument) gets the value of subdir.FullName and Listboxator (the second argument) gets the value of Diskator (the Diskator in the caller's scope, that is).

Specifying the types of parameters in the function declaration will help catch mistakes like this. Avoiding overlaps between parameter names and global variable/member names can also make things less confusing.
Post edited February 09, 2013 by drennan
avatar
Detlik: Good day to every single one of you,
Big surprise, I screwed yet something else up. I somewhat advanced in my studies of Visual Basic, but apparently its not good enough, since I require assistance. In my school we have assignment to make our version of Total Commander/File Manager, and I have trouble putting up together. I am not asking for someone to put it up together for me, because what would be the point of that? All I am asking is if there is someone here skilled in Visual Basic, who would be able to provide me with advice, answers to my questions and maybe even teach me things or two.

If I had some money I would held up a contest for GOG games or other, but unfortunately I don't have cash, so all I can offer is my gratitude and/or tons of copies of DOTA 2
VB or VB.NET?