PageRenderTime 45ms CodeModel.GetById 23ms RepoModel.GetById 0ms 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
Possible License(s): CC-BY-SA-3.0, Apache-2.0, BSD-3-Clause, LGPL-2.1, MPL-2.0-no-copyleft-exception, AGPL-3.0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using System.Drawing.Printing;
  10. using System.IO;
  11. using System.Net;
  12. using System.Collections.Specialized;
  13. using System.Configuration;
  14. using System.Xml.Linq;
  15. namespace CmsCheckin
  16. {
  17. public partial class BaseForm : Form
  18. {
  19. UserControl home;
  20. public BaseForm(UserControl home)
  21. {
  22. this.home = home;
  23. InitializeComponent();
  24. }
  25. public TextBox textbox;
  26. private void BaseForm_Load(object sender, EventArgs e)
  27. {
  28. Program.CursorHide();
  29. ControlsAdd(home);
  30. home.Visible = true;
  31. if (home is Home)
  32. textbox = ((Home)home).textBox1;
  33. else if (home is Home2)
  34. textbox = ((Home2)home).textBox1;
  35. }
  36. public void ControlsAdd(UserControl ctl)
  37. {
  38. ctl.Location = new Point { X = (this.Width / 2) - (ctl.Width / 2), Y = 0 };
  39. ctl.Visible = false;
  40. Controls.Add(ctl);
  41. }
  42. private void BaseForm_Resize(object sender, EventArgs e)
  43. {
  44. home.Location = new Point { X = (this.Width / 2) - (home.Width / 2), Y = 0 };
  45. }
  46. private void BaseForm_LocationChanged(object sender, EventArgs e)
  47. {
  48. Settings1.Default.BaseFormLocX = this.Location.X;
  49. Settings1.Default.BaseFormLocY = this.Location.Y;
  50. Settings1.Default.Save();
  51. }
  52. }
  53. }