private void btnSetLogFilterAlarmType_Click(object sender, EventArgs e) { EventHandler handler = null; if (!Variable.bLogin) { MessageBox.Show("对不起,请登录系统后设置该参数!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); } else { if (this.alarmType == null) { SetLogFilterAlarmType type = new SetLogFilterAlarmType { Visible = false }; this.alarmType = type; base.Controls.Add(this.alarmType); this.drpSetLogFilterAlarmType = new WinFormsUI.Controls.AutoDropDown(this.alarmType); base.Controls.Add(this.drpSetLogFilterAlarmType); if (handler == null) { handler = delegate(object obj, EventArgs e1) { this.setLogFilterAlarmTypeValue = obj.ToString(); this.drpSetLogFilterAlarmType.HideDropDown(); }; } this.alarmType.SetParam += handler; } this.alarmType.Init(); this.drpSetLogFilterAlarmType.ShowDropDown(new Point(this.gbAlarm.Location.X + 40, this.gbAlarm.Location.Y + 20)); } }