Beispiel #1
0
        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();
        }
Beispiel #2
0
        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");
                }
            }
        }