![]() Closing the MDI child window removes the inserted menu items from the MDI parent. The following procedure uses the IsMdiContainer, AllowMerge, MergeAction, and MergeIndex properties to insert a group of menu items from the MDI child menu into the drop-down part of the MDI parent menu. ![]() In that case, you want to update the contents of the MDI parent's menu with the contents of the MDI child's menu as MDI child windows of different kinds are activated. For example, the MDI parent might be a spreadsheet, and the MDI child might be a chart. In some applications, the kind of a multiple-document interface (MDI) child window can be different from the MDI parent window. Slow Chat: Visual C++: Yesterday, Today, and Tomorrow.Slow Chat: Developing Multithreaded Applications.Slow Chat: Talk with Microsoft Developer Teams.IoT, IoE, and Maker Forum (on VBForums).Project Planning, Design, and Management.Scripting - Server Side (PHP, Perl, etc.).Windows Presentation Foundation (WPF) & XAML forum.NET Installation and Configuration Issues This.name = path.Substring(path.LastIndexOf("\\")+1) // remove path String curr_path = getPath(()) Ĭurr_path = curr_path.Substring(0, curr_path.LastIndexOf("\\")) set to variable the location we wanted to open Private void openFolderToolStripMenuItem_Click(object sender, EventArgs e) when mouse click and the data is availableĬontextMenuStrip1.Show(this, this.PointToClient(Cursor.Position)) make the items to automaticly selected Int temp_index = e.Y/listBox1.ItemHeight If (e.Button = MouseButtons.Right & != 0) Private void listBox1_MouseUp(object sender, MouseEventArgs e) If (e.Data.GetDataPresent(DataFormats.FileDrop)) nessesary to allow file to be dropped at the component Private void listBox1_DragEnter(object sender, DragEventArgs e) GetFiles(data) // call a recusive function to search data on folder ![]() ![]() If (data.LastIndexOf(".") >= 0)// based on extention String directoryName = (string)e.Data.GetData(DataFormats.FileDrop) Private void listBox1_DragDrop(object sender, DragEventArgs e) String folders = Directory.GetDirectories(Folder_Path) // get all folder on the directory String files = Directory.GetFiles(Folder_Path) // get all file on the directory Private void getFiles(String Folder_Path) add data to our collection temp and the list on the form use this to get the path based on items name If anything is not clear plz do ask and thank you very much all helps are appreciated. Hope that can help you a bit, if you need to know more ask, I also have a code to calculate the size of the file, i didn't insert is because I don't think you will need it really. String directories = new string extensions = new string )) Private void button1_Click(object sender, EventArgs e) The implementation I have for the scanning files and displaying them on list view is: That does open the custom location, however since there is going to be lots of files in the list view, I need the program to get the file location it self. Process.Start("explorer.exe", "I need filepath from listview item") If user right clicks the item and says open, its should ask the user what do you want to open it with using Windows explorer! For the open file location, I came up with this: I have 3 options on the context menu strip, open, open file location and properties. The problem about this code is longest the item is selected it will display the menu strip, what I don't want is the context menu strip shouldn't show up unless directly right clicked on the item. Point pt = listView1.PointToScreen(e.Location) Private void contextMenuStrip1_MouseClick(object sender, MouseEventArgs e) Private void contextMenuStrip1_Opening(object sender, CancelEventArgs e) Display context menu strip only when mouse is over the item and right clicked on it, the code I have for that is this:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |