private void button2_Click(object sender, EventArgs e) { int width = 450; New_Window newWindow = new New_Window(new New_Window.Attr_C() { width = width }); //创建一个列表 list = new Flp_List(new Flp_List.Attr_C() { width = width }); for (int i = 0; i < 10; i++) { list.Add_Record("按键" + i, "注释" + i); } newWindow.Controls.Add(list.Flp_list); newWindow.Show(); list.Select_UpDown_Item(true); }
private void button1_Click(object sender, EventArgs e) { vEw1.Show(); }
/// <summary> /// 鼠标信息处理 /// </summary> public void Mouse_Handler(InputHook v_ih, MouseEventArgs mea) { //如果鼠标左键等于按下状态并且鼠标滚轮有滚动,并且不再模拟状态 if (v_ih.keyStateAll[Keys.LMenu] == true && mea.Delta != 0 && course.be_simulate == false) { if (course.is_Lock_Handle == false) { course.Handle = v_ih.window_Info_Mouse.Root_IntPtr; //设置鼠标所在窗口句柄 } //如果窗口已被销毁 if (new_Window == null) { new_Window = new New_Window(new New_Window.Attr_C() { width = new_window_width }); new_Window.SuspendLayout(); new_Window.Opacity = 0.65; flpList = new Controls_FlpList(new Controls_FlpList.Attr_C() { width = new_window_width }); course.titleName = v_ih.window_Info_Mouse.Root_title.ToString(); course.className = v_ih.window_Info_Mouse.Root_className.ToString(); vHe_Lisy = vShm.Get_Key_List(course.titleName, course.className); for (int i = 0; i < vHe_Lisy.Count; i++) { flpList.Add_Record(vHe_Lisy[i].Key_Text, vHe_Lisy[i].comment); } flpList.Selected_Index = 0; //设置选中第一条 new_Window.Controls.Add(flpList.Flp_list); //将列表添加到窗口 new_Window.ResumeLayout(false); //布局相关 new_Window.PerformLayout(); //布局相关 new_Window.TopMost = true; //窗口在最前 new_Window.ControlBox = false; //不显示控制按钮 new_Window.ShowInTaskbar = false; //不显示在任务栏 new_Window.StartPosition = FormStartPosition.Manual; //让窗体的位置由Location属性决定 //设置显示位置 new_Window.Location = (Point) new Size( mea.Location.X - 10, mea.Location.Y - 10 ); new_Window.Text = v_ih.window_Info_Mouse.title.ToString(); //设置窗口标题 new_Window.Show(); //显示窗口 SwitchToThisWindow(new_Window.Handle, true); //窗口置顶 } if (mea.Delta < 0) { flpList.Select_UpDown_Item(true); //选择下一条 } else { flpList.Select_UpDown_Item(false); //选择上一条 } } }