Beispiel #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            CustomForm form = new CustomForm();

            form.MdiParent = this; // MdiParent속성으로 부모를 자기자신으로 지정.
            form.Show();
        }
Beispiel #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            CustomForm form = new CustomForm();

            form.MdiParent = this; //2. 자식에 해당하는 폼 호출할 때, 부모를 지정한다.
            form.Show();
        }
Beispiel #3
0
        private void button1_Click(object sender, EventArgs e)
        {
            CustomForm form = new CustomForm();

            //form.MdiParent = this;  //애가 없으면 모달, 생긴게 form 닫거나 밖에 가야지 새론거 생성가능한다
            form.Show();
        }
Beispiel #4
0
        private void SecondBtn_Click(object sender, EventArgs e)
        {
            CustomForm custom = new CustomForm();

            Form1.S_form.Push(custom);
            custom.Text = "CustomForm";
            custom.Show();
        }
Beispiel #5
0
        public Form1()
        {
            InitializeComponent();
            IsMdiContainer = true;
            CustomForm form = new CustomForm();

            form.Show();
        }
Beispiel #6
0
        private void label1_Click(object sender, EventArgs e)
        {
            CustomForm form = new CustomForm();

            form.MdiParent = this;
            form.Show();
            //form.ShowDialog(); // 모달 타입
        }
Beispiel #7
0
        private void button1_Click(object sender, EventArgs e)
        {
            CustomForm form = new CustomForm();

            // 모달리스 form창 생성 (새로운 화면이 열려도 기존에 있던 화면 조작 가능)
            form.Show();

            // 모달 form창 생성 (새로운 화면을 띄웠을 때 기존 화면 조작 불가능)
            form.ShowDialog();
        }
Beispiel #8
0
 private void ShowChildForm(Form senderForm)
 {
     if (senderForm == null)
     {
         return;
     }
     HideChildForm();
     currentChildForm = senderForm as CustomForm;
     currentChildForm.BringToFront();
     currentChildForm.Show();
 }
Beispiel #9
0
        private void frmFlights_Load(object sender, EventArgs e)
        {
            currentChildForm = new frmFlightsList();

            currentChildForm.TopLevel = false;
            currentChildForm.Dock     = DockStyle.Fill;
            pnDesktop.Controls.Add(currentChildForm);
            currentChildForm.BringToFront();
            currentChildForm.Show();

            btnChuyenBay.Checked = true;
        }
Beispiel #10
0
        public Form1()
        {
            InitializeComponent();
            IsMdiContainer = true;
            DialogResult result = MessageBox.Show("DB연결을 하시겠습니까?", "", MessageBoxButtons.YesNo);

            if (result == DialogResult.Yes)
            {
                CustomForm form = new CustomForm();
                form.MdiParent = this; // MdiParent속성으로 부모를 자기자신으로 지정.
                form.Show();
            }
        }
Beispiel #11
0
 private void ShowChildForm(CustomForm senderForm)
 {
     if (senderForm == null)
     {
         return;
     }
     HideChildForm();
     currentChildForm          = senderForm;
     currentChildForm.TopLevel = false;
     currentChildForm.Dock     = DockStyle.Fill;
     pnDesktop.Controls.Add(currentChildForm);
     currentChildForm.BringToFront();
     currentChildForm.Show();
 }
Beispiel #12
0
        // End btnReports Handlers

        // Start Miscellaneus Methods
        private void AddWindow <CustomForm>() where CustomForm : Form, new()
        {
            // Busca en los controles del panel windowsContainer el primer control que sea de tipo CustomForm
            Form window = windowsContainer.Controls.OfType <CustomForm>().FirstOrDefault();

            if (window == null)
            {
                window          = new CustomForm();
                window.TopLevel = false;
                window.Dock     = DockStyle.Fill;
                windowsContainer.Controls.Add(window);
                windowsContainer.Tag = window;
                window.Show();
                window.BringToFront();
            }
            else
            {
                window.BringToFront();
            }
        }
Beispiel #13
0
            public void Start()
            {
                Console.WriteLine("Checking for update.");

                if (_client == null)
                {
                    _client = new WebClient();
                }

                _client.Proxy = null;
                Checking      = true;

                try
                {
#if BETA
                    CustomForm form = new CustomForm()
                    {
                        Text          = "Check for updates",
                        StartPosition = FormStartPosition.CenterScreen,
                        ControlBox    = false,
                        Sizable       = false,
                        Icon          = Icon.ExtractAssociatedIcon(Application.ExecutablePath),
                        Size          = new Size(350, 150),
                        TopMost       = true
                    };

                    Label label = new Label()
                    {
                        Font      = new Font("Segoe UI", 20, FontStyle.Regular),
                        ForeColor = Color.White,
                        Text      = "Checking...",
                        AutoSize  = true,
                    };
                    label.Location = new Point(form.Width / 2 - label.Width / 2 - 25, form.Height / 2 - label.Height / 2);
                    label.Parent   = form;
                    form.Show();

                    Version checkedVersion = new Version(_client.DownloadString(new Uri("http://razorenhanced.org/download/Version-EM-Beta.txt")));

                    if (checkedVersion > MainCore.MapVersion)
                    {
                        form.Close();

                        form = new CustomForm()
                        {
                            Text          = "New updates available!",
                            StartPosition = FormStartPosition.CenterScreen,
                            ControlBox    = false,
                            Sizable       = false,
                            Icon          = Icon.ExtractAssociatedIcon(Application.ExecutablePath),
                            Size          = new Size(350, 150),
                            TopMost       = true
                        };

                        label = new Label()
                        {
                            Font      = new Font("Segoe UI", 20, FontStyle.Regular),
                            ForeColor = Color.White,
                            Text      = "Updating...",
                            AutoSize  = true,
                        };
                        label.Location = new Point(form.Width / 2 - label.Width / 2 - 25, form.Height / 2 - label.Height / 2);
                        label.Parent   = form;

                        Task.Run(() =>
                        {
                            string path = Path.Combine(Path.GetTempPath(), "Enhanced-Map-Beta.zip");

                            if (File.Exists(path))
                            {
                                File.Delete(path);
                            }

                            _client.DownloadFile("http://razorenhanced.org/download/Enhanced-Map-Beta.zip", path);

                            string pathtoextract = Path.Combine(Path.GetTempPath(), "map-beta");
                            if (Directory.Exists(pathtoextract))
                            {
                                Directory.Delete(pathtoextract, true);
                            }

                            ZipFile.ExtractToDirectory(path, pathtoextract);

                            Process p = new Process
                            {
                                StartInfo =
                                {
                                    FileName        = Path.Combine(pathtoextract, "EnhancedMap.exe"),
                                    UseShellExecute = false,
                                    Arguments       =
                                        $"--source \"{Application.ExecutablePath}\" --pid {Process.GetCurrentProcess().Id} --action update"
                                }
                            };
                            p.Start();
                            Process.GetCurrentProcess().Kill();
                        });

                        form.ShowDialog();
                    }
                    if (form != null && !form.Disposing)
                    {
                        form.Close();
                    }
#else
                    _client.DownloadStringCompleted += m_Client_DownloadStringCompleted;
                    _client.DownloadStringAsync(new Uri("http://razorenhanced.org/download/Version-EM.txt"));
#endif
                }
                catch (WebException webEx)
                {
                    Checking = false;
                    MessageBox.Show("Failed to comunicate with server", "Error");
                }
                catch (Exception ex)
                {
                    Checking = false;
                    MessageBox.Show("Failed to download new version.", "Error");
                }
            }
Beispiel #14
0
        private void button1_Click(object sender, EventArgs e)
        {
            CustomForm form = new CustomForm();

            form.Show();
        }