Пример #1
0
        private void btnXemNoiDung_Click(object sender, EventArgs e)
        {
            string FilePath = txtDuongDan.Text;

            if (FilePath == "")
            {
                MessageBox.Show("Bạn phải nhập thông tin đường dẫn", "Thông báo", MessageBoxButtons.OK);
                txtDuongDan.Focus();
            }
            else
            {
                ThongTinHienThi(FilePath);
                ext = ext.ToLower();
                if (ext == ".txt")
                {
                    frmVanBan FormVB = new frmVanBan();
                    FormVB.GetPathVB(FilePath);
                    FormVB.Getext(ext);
                    FormVB.Show();
                }
                else if (ext == ".xls")
                {
                    frmExcel FormExcel = new frmExcel();
                    FormExcel.GetPathExcel(FilePath);
                    FormExcel.Show();
                }
                else if (ext == ".doc")
                {
                    frmWord FormWord = new frmWord();
                    FormWord.GetPathWord(FilePath);
                    FormWord.Show();
                }
                else if (ext == ".jpg" || ext == ".gif" || ext == ".bmp" || ext == ".ico" || ext == ".psd")
                {
                    frmHinhAnh FormHinhAnh = new frmHinhAnh();
                    FormHinhAnh.GetPathHA(FilePath);
                    FormHinhAnh.Show();
                }
                else if (ext == ".mp3" || ext == ".mp4" || ext == ".wmv" || ext == ".3gp" || ext == ".avi")
                {
                    frmNhac FormNhac = new frmNhac();
                    FormNhac.GetPathMedia(FilePath);
                    FormNhac.Show();
                }
                else
                {
                    MessageBox.Show("Định dạng này chúng tôi chưa hỗ trợ để có thể mở !", "Thông Báo", MessageBoxButtons.OK);
                }
            }
        }
Пример #2
0
        private void btnPicture_Click(object sender, EventArgs e)
        {
            frmHinhAnh FormHinhAnh = new frmHinhAnh();

            FormHinhAnh.Show();
        }