frmLogin.cs 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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 LYFZ.OtherExpansion.SkinControl;
  10. using LYFZ.Model;
  11. namespace LYFZ.Software.UI
  12. {
  13. public partial class frmLogin : LYFZ.ComponentLibrary.BaseForm360
  14. {
  15. protected Model_ErpUser loginUserModel = new Model_ErpUser();
  16. public frmLogin()
  17. {
  18. InitializeComponent();
  19. this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
  20. this.stxtPwd.BaseText.PasswordChar = '*';
  21. this.stxtPwd.BaseText.UseSystemPasswordChar = true;
  22. // this.IsCloseForm = false;
  23. //this.btnAppFormExit.Click += new EventHandler(OverridebtnAppFormExit_Click);
  24. }
  25. /// <summary>
  26. ///
  27. /// </summary>
  28. /// <param name="sender"></param>
  29. /// <param name="e"></param>
  30. protected virtual void sBtnLogin_Click(object sender, EventArgs e)
  31. {
  32. }
  33. /// <summary>
  34. ///
  35. /// </summary>
  36. /// <param name="sender"></param>
  37. /// <param name="e"></param>
  38. protected virtual void stxtPwd_IconClick(object sender, EventArgs e)
  39. {
  40. PassKey pass = new PassKey(this.Left + stxtPwd.Left - 100, this.Top + stxtPwd.Bottom, this.textBoxPwd);
  41. pass.Show(this);
  42. }
  43. protected virtual void sMenuStripId_Closing(object sender, ToolStripDropDownClosingEventArgs e)
  44. {
  45. this.stxtUserName.Icon =LYFZ.Software.UI.Properties.Resources.login_inputbtn_normal;
  46. }
  47. protected virtual void stxtUserName_IconClick(object sender, EventArgs e)
  48. {
  49. if (this.sMenuStripId.Items.Count > 0)
  50. {
  51. stxtUserName.Icon = LYFZ.Software.UI.Properties.Resources.login_inputbtn_down;
  52. }
  53. this.sMenuStripId.Show(this.stxtUserName, 1, this.stxtUserName.Height + 1);
  54. }
  55. // private static string[] NickNameArray = { "刘超", "王剑峰", "湖海峰", "滕召禄", "张三", "李四", "王五", "小张", "王二小" };
  56. protected virtual void frmLogin_Load(object sender, EventArgs e)
  57. {
  58. this.stxtPwd.BaseText.PasswordChar = '*';
  59. this.stxtPwd.BaseText.UseSystemPasswordChar = true;
  60. //this.sMenuStripId.Height += 220;
  61. //for (int i = 0; i < 9; i++)
  62. //{
  63. // string testUserName = "Account00"+(1+i).ToString();
  64. // string nickName =frmLogin.NickNameArray[i];
  65. // ToolStripMenuItem item = new ToolStripMenuItem();
  66. // item.AutoSize = false;
  67. // item.Size = new System.Drawing.Size(182, 40);
  68. // item.Text = nickName + "\r\n" + testUserName;
  69. // item.Tag = new string[] { testUserName, nickName }; //Tag用于存储UserID 和 NickName
  70. // item.Image = LYFZ.WinAPI.CustomPublicMethod.GetMenuItemImage("/Avatar/Tx" + (i+1).ToString() + ".png"); //根据ID获取头像
  71. // item.Click += new EventHandler(toolStripMenuItemID_Click);
  72. // ToolStripSeparator spItem = new ToolStripSeparator();
  73. // this.sMenuStripId.Items.Add(item);
  74. // this.sMenuStripId.Items.Add(spItem);
  75. //}
  76. }
  77. #region toolStripMenuItemID_Click
  78. //从帐号下拉列表中 选中某个登录帐号
  79. protected virtual void toolStripMenuItemID_Click(object sender, EventArgs e)
  80. {
  81. // ToolStripMenuItem item = (ToolStripMenuItem)sender;
  82. // string[] tag = (string[])item.Tag;
  83. // stxtUserName.Text = tag[0];
  84. //spalHead.BackgroundImage = item.Image;
  85. }
  86. #endregion
  87. }
  88. }