PageRenderTime 0ms CodeModel.GetById 15ms app.highlight 6ms RepoModel.GetById 2ms app.codeStats 0ms

/CmsCheckin/BaseForm.cs

https://bitbucket.org/mahalowe/bvcms
C# | 60 lines | 53 code | 7 blank | 0 comment | 3 complexity | ff111aa00362f539e2582c8fec569c82 MD5 | raw file
 1using System;
 2using System.Collections.Generic;
 3using System.ComponentModel;
 4using System.Data;
 5using System.Drawing;
 6using System.Linq;
 7using System.Text;
 8using System.Windows.Forms;
 9using System.Drawing.Printing;
10using System.IO;
11using System.Net;
12using System.Collections.Specialized;
13using System.Configuration;
14using System.Xml.Linq;
15
16namespace CmsCheckin
17{
18    public partial class BaseForm : Form
19    {
20
21		UserControl home;
22        public BaseForm(UserControl home)
23        {
24			this.home = home;
25            InitializeComponent();
26        }
27
28		public TextBox textbox;
29        private void BaseForm_Load(object sender, EventArgs e)
30        {
31			Program.CursorHide();
32            ControlsAdd(home);
33			home.Visible = true;
34			if (home is Home)
35				textbox = ((Home)home).textBox1;
36			else if (home is Home2)
37				textbox = ((Home2)home).textBox1;
38        }
39
40
41        public void ControlsAdd(UserControl ctl)
42        {
43            ctl.Location = new Point { X = (this.Width / 2) - (ctl.Width / 2), Y = 0 };
44            ctl.Visible = false;
45            Controls.Add(ctl);
46        }
47
48		private void BaseForm_Resize(object sender, EventArgs e)
49		{
50            home.Location = new Point { X = (this.Width / 2) - (home.Width / 2), Y = 0 };
51		}
52
53		private void BaseForm_LocationChanged(object sender, EventArgs e)
54		{
55			Settings1.Default.BaseFormLocX = this.Location.X;
56			Settings1.Default.BaseFormLocY = this.Location.Y;
57			Settings1.Default.Save();
58		}
59    }
60}