定义几个全局静态变量:
public static Formyhdl yhdl;
public static string lc_cdbms = string.Empty; //菜单项索引号字符串
public static string lc_yhbms = string.Empty; //用户编码
public static string lc_yhxms = string.Empty; //用户姓名
public static string lc_jsmcs = string.Empty; //角色名称
public static string lc_dwmcs = string.Empty; //单位名称
public static string lc_yhmms = string.Empty; //用户密码
private System.Windows.Forms.MainMenu mainMenu1 = new MainMenu();
private System.Windows.Forms.MenuItem menuItem1 = new MenuItem();
private int x1 = 0;
窗体加载事件中,有关调用用户登陆窗体以及如何进入动态菜单系统代码:
private void FormZct_Load(object sender, EventArgs e)
{
this.Location = new System.Drawing.Point(0, 20);
this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
this.TopMost = false;
this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
this.ControlBox = true;
this.MaximizeBox = false;
this.MinimizeBox = true;
yhdl = new Formyhdl();
yhdl.ShowDialog(); //调用登陆子窗体
if (lc_cdbms == "")
{
|