コード例 #1
0
ファイル: frmpictureview.cs プロジェクト: toanlqctk42/LT_CSDL
        private void newToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OpenFileDialog openfile = new OpenFileDialog();

            if (openfile.ShowDialog() == DialogResult.OK)
            {
                frmpicture frm = new frmpicture(openfile.FileName);
                frm.MdiParent = this;
                count++;
                frm.Text = "Picture - " + count + "-" + openfile.FileName;
                frm.Show();
            }
            this.toolStripStatusLabel1.Text = "Tổng số form con " + count.ToString();
        }
コード例 #2
0
ファイル: frmpictureview.cs プロジェクト: toanlqctk42/LT_CSDL
        private void saveAsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            SaveFileDialog savefile = new SaveFileDialog();

            if (savefile.ShowDialog() == DialogResult.OK)
            {
                frmpicture frm = this.ActiveMdiChild as frmpicture;
                try
                {
                    Image img = frm.pbHinh.Image;
                    img.Save(savefile.FileName, ImageFormat.Bmp);
                }
                catch
                {
                    MessageBox.Show("Lỗi Lưu File");
                }
            }
        }