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();
- }
- }
- }
6 Replies
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Sachin SinghPosted Nov 4, 2020, 10:31 PM
Guest UserPosted Nov 7, 2020, 10:09 AM
Sachin SinghPosted Nov 6, 2020, 10:48 PM
Guest UserPosted Nov 6, 2020, 5:37 PM
Sachin SinghPosted Nov 5, 2020, 9:53 PM
Guest UserPosted Nov 5, 2020, 6:02 PM