示例#1
0
        private void button5_Click(object sender, EventArgs e)
        {
            ShowForm1 sf = new ShowForm1()
            ;

            sf.Show();
            ShowFome2 sf2 = new ShowFome2();

            sf2.Show();
        }
示例#2
0
        public Form1()
        {
            InitializeComponent();
            if (System.IO.File.Exists("profile.cfg"))
            {
                foreach (string s in System.IO.File.ReadLines(@"profile.cfg"))
                {
                    if (string.IsNullOrEmpty(s) == true)
                    {
                    }
                    else
                    {
                        string[] numbers     = s.Replace("\r\n", "").Split('|');
                        string   name        = numbers[0];
                        Point    windowPoint = new Point(int.Parse(numbers[1]),
                                                         int.Parse(numbers[2]));
                        Size windowSize = new Size(int.Parse(numbers[3]), int.Parse(numbers[4]));

                        if (name == "ShowForm1")
                        {
                            ColorConverter cc = (new ColorConverter());
                            ShowForm1      sf = new ShowForm1();
                            sf.BackColor = (Color)cc.ConvertFromString(numbers[6]);
                            sf.Show();
                            sf.Size     = windowSize;
                            sf.Location = windowPoint;
                        }
                        else if (name == "Form1")
                        {
                            this.Location = windowPoint;
                            this.Size     = windowSize;
                        }
                        else if (name == "ShowFome2")
                        {
                            ShowFome2 sf = new ShowFome2();
                            sf.Show();
                            sf.Size     = windowSize;
                            sf.Location = windowPoint;
                        }

                        {
                            string windowString = numbers[4];
                            if (windowString == "Normal")
                            {
                                //this.StartPosition = FormStartPosition.Manual;
                            }
                            else if (windowString == "Maximized")
                            {
                                //this.Location = new Point(100, 100);
                                //this.StartPosition = FormStartPosition.Manual;
                                //this.WindowState = FormWindowState.Maximized;
                            }
                        }
                    }
                }
            }
            else
            {
                this.StartPosition = FormStartPosition.CenterScreen;
            }
        }