Ejemplo n.º 1
0
        private void menuItemNew_Click(object sender, EventArgs e)
        {
            var isOK = openFileDialog1.ShowDialog();

            if (isOK == DialogResult.OK)
            {
                frmPicture frm = new frmPicture(openFileDialog1.FileName);
                frm.MdiParent = this;
                this.menuStrip1.AllowMerge = false;
                count++;
                frm.Text = "Picture - " + count + " - " + openFileDialog1.FileName;
                frm.Show();
            }

            toolStripStatusLabel1.Text = "Tổng số Form con: " + count.ToString();
        }
Ejemplo n.º 2
0
        private void menuItemSaveAs_Click(object sender, EventArgs e)
        {
            var isOK = saveFileDialog1.ShowDialog();

            if (isOK == DialogResult.OK)
            {
                frmPicture frm = this.ActiveMdiChild as frmPicture;

                try
                {
                    Image img = frm.pbHinh.Image;
                    img.Save(saveFileDialog1.FileName, ImageFormat.Bmp);
                }
                catch
                {
                    MessageBox.Show("Lỗi lưu file!");
                }
            }
        }