Form 1 Code
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- namespace WindowsFormsApp1
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- string[] paths, files;
- private void showform2_Click(object sender, EventArgs e)
- {
- Form2 f22 = new Form2();
- f22.Show();
- }
- private void Form1_Load(object sender, EventArgs e)
- {
- }
- private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
- {
- }
- private void btnopenfiles_Click(object sender, EventArgs e)
- {
- OpenFileDialog ofd = new OpenFileDialog();
- ofd.Multiselect = true;
- if (ofd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
- {
- files = ofd.SafeFileNames;
- paths = ofd.FileNames;
- for(int i =0;i
- {
- listBox1.Items.Add(files[i]);
- }
- }
- }
- }
- }
Form 2 Code
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- namespace WindowsFormsApp1
- {
- public partial class Form2 : Form
- {
- public Form2()
- {
- InitializeComponent();
- }
- }
- }

Sachin SinghRank #66 · 26.2K reputationPosted Nov 4, 2020, 5:31 PM EST
Sachin SinghRank #66 · 26.2K reputationPosted Nov 6, 2020, 5:48 PM EST
Guest UserRank #1,881 · 787 reputationPosted Nov 5, 2020, 1:02 PM EST
Sachin SinghRank #66 · 26.2K reputationPosted Nov 5, 2020, 4:53 PM EST
Guest UserRank #1,881 · 787 reputationPosted Nov 6, 2020, 12:37 PM EST
Guest UserRank #1,881 · 787 reputationPosted Nov 7, 2020, 5:09 AM EST