MainForm.cs 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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.Threading.Tasks;
  9. using System.Windows.Forms;
  10. using ShareWifi.Views;
  11. namespace ShareWifi
  12. {
  13. public partial class MainForm : Form
  14. {
  15. HomeControl home;
  16. AboutMe aboutMe;
  17. public MainForm()
  18. {
  19. InitializeComponent();
  20. }
  21. private void label3_Click(object sender, EventArgs e)
  22. {
  23. }
  24. private void btnGenerate_Click(object sender, EventArgs e)
  25. {
  26. }
  27. private void btnHome_Click(object sender, EventArgs e)
  28. {
  29. interHome();
  30. }
  31. public void interHome()
  32. {
  33. if (home == null)
  34. {
  35. home = HomeControl.getInstance();
  36. }
  37. plContent.Controls.Clear();
  38. plContent.Controls.Add(home);
  39. }
  40. private void btnAboutMe_Click(object sender, EventArgs e)
  41. {
  42. if (aboutMe == null)
  43. {
  44. aboutMe = AboutMe.getInstance();
  45. }
  46. plContent.Controls.Clear();
  47. plContent.Controls.Add(aboutMe);
  48. }
  49. private void btnMini_Click(object sender, EventArgs e)
  50. {
  51. }
  52. private void btnClose_Click(object sender, EventArgs e)
  53. {
  54. Application.Exit();
  55. }
  56. private void MainForm_Load(object sender, EventArgs e)
  57. {
  58. interHome();
  59. }
  60. }
  61. }