Example #1
0
        private void openDICOMFileToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmDicomReader frm = new frmDicomReader();

            MaskedDialog.ShowDialog(this, frm);
            frm.Dispose();
            frm = null;
        }
Example #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            frmDicomReader frm = new frmDicomReader();

            MaskedDialog.ShowDialog(this, frm);
            frm.Dispose();
            frm = null;
        }
Example #3
0
        private void btnAddConnect_Click(object sender, EventArgs e)
        {
            // Show form nhập IP & QR code
            frmScan frm = new frmScan();

            MaskedDialog.ShowDialog(this, frm);
            frm.Dispose();
            frm = null;
        }
Example #4
0
        //
        public static DialogResult ShowDialog(Form parent, Form dialog)
        {
            mask = new MaskedDialog(parent, dialog);
            dialog.StartPosition = FormStartPosition.CenterParent;
            mask.MdiParent       = parent.MdiParent;
            mask.Show();
            DialogResult result = dialog.ShowDialog(mask);

            mask.Close();
            return(result);
        }
Example #5
0
        public static DialogResult ShowDialog(Form parent, UserControl dialog)
        {
            mask         = new MaskedDialog(parent, dialog);
            frmContainer = new Form();
            frmContainer.ShowInTaskbar   = false;
            frmContainer.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
            frmContainer.StartPosition   = FormStartPosition.CenterScreen;
            frmContainer.Height          = dialog.Height;
            frmContainer.Width           = dialog.Width;

            frmContainer.Controls.Add(dialog);
            mask.MdiParent = parent.MdiParent;
            mask.Show();
            DialogResult result = frmContainer.ShowDialog(mask);

            frmContainer.Close();
            mask.Close();
            return(result);
        }
Example #6
0
        private void webMain_Navigating(object sender, WebBrowserNavigatingEventArgs e)
        {
            e.Cancel = true;
            if (e.Url.ToString() != "about:blank")
            {
                string Address = "";
                string url     = e.Url.PathAndQuery;
                Address = url.Replace("(~*)", ":");
                Uri uri = new UriBuilder()
                {
                    Scheme = Uri.UriSchemeFile, Host = "", Path = Address
                }.Uri;
                bool isDicomFile = Path.GetFileName(uri.LocalPath).EndsWith("dcm");
                Address = uri.LocalPath;
                if (File.Exists(Address))
                {
                    try
                    {
                        if (isDicomFile)
                        {
                            frmDicomReader frm = new frmDicomReader(Address);
                            MaskedDialog.ShowDialog(this, frm);
                            frm.Dispose();
                            frm = null;
                        }

                        else
                        {
                            Process.Start("explorer.exe", " /select, " + Address);
                        }
                    }
                    catch
                    {
                        MessageBox.Show("Không thể mở file");
                    }
                }
                else
                {
                    MessageBox.Show("Tập tin không tồn tại");
                }
            }
        }