ToolStripMenuItem - HELP wanted

MadSkillz

Member
Joined
Jan 31, 2011
Messages
5
Programming Experience
Beginner
Hello!
Can a ToolStripMenuItem do the following with only 1 click?
1) move the selected files from a listbox in a folder "X"
2) launch a Tipar.bat file (Tipar.bar change the extensions of the files that was moved into "X" folder and after that moves them into folder "Y")
3) moves the files from the "Y" folder into another folder.

I'm not sure if I made myself clear.
 

Attachments

  • rxfer1.jpg
    rxfer1.jpg
    324.5 KB · Views: 29
A ToolStripMenuItem doesn't do any of that. All the ToolStripMenuItem does is display a menu item to the user and raise its Click event when the user clicks it. That's it, that's all. What you do when that Click event is raised is completely up to you. You can do a thousand different things or more on one or more threads that take as long as you like. Anything that a VB app can do can be done when a ToolStripMenuItem is clicked.
 
A ToolStripMenuItem is a ToolStripMenuItem and a Button is a Button. They both act as exactly what they are. Again, the menu item, or the Button for that matter, don;t actually do any of the work. All they do is raise an event in response to a user action. Specifically they both raise a Click event when the user clicks them. That is the sum total of their part in proceedings. It's up to you to handle that Click event and execute the appropriate code. That code can be basically anything you want. If you want to copy files then write code to copy files. Etc, etc. You can put the code right into the Click event handler if you want or, preferably, put the code for each action into its own method and then call those methods from the Click event handler.
 
Can you provide me with a link to a file manager (like total commander or windows commander) made in VB.net I think that will help
 
It should be something like this but is not working


Private Sub ToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.Windows.Controls.SelectionChangedEventArgs) Handles ToolStripMenuItem1.Click
My.Computer.FileSystem.MoveFile(listbox1.Items.Item(i).ToString, "destination") 'Here i is the index location of the item
Process.Start("Tipar.bat")
End Sub
 
Back
Top