правим всплывающий список
This commit is contained in:
parent
6af2875ad1
commit
38b5531fb0
|
|
@ -195,6 +195,7 @@
|
|||
this.flowLayoutPanel1.Size = new System.Drawing.Size(396, 657);
|
||||
this.flowLayoutPanel1.TabIndex = 0;
|
||||
this.flowLayoutPanel1.WrapContents = false;
|
||||
this.flowLayoutPanel1.MouseClick += new System.Windows.Forms.MouseEventHandler(this.tabControl1_MouseClick);
|
||||
//
|
||||
// tabPage2
|
||||
//
|
||||
|
|
@ -376,6 +377,7 @@
|
|||
this.tabPage4.TabIndex = 3;
|
||||
this.tabPage4.Text = "Настройки";
|
||||
this.tabPage4.UseVisualStyleBackColor = true;
|
||||
this.tabPage4.MouseClick += new System.Windows.Forms.MouseEventHandler(this.tabControl1_MouseClick);
|
||||
//
|
||||
// button4
|
||||
//
|
||||
|
|
@ -398,6 +400,7 @@
|
|||
this.tabPage5.TabIndex = 4;
|
||||
this.tabPage5.Text = "О программе";
|
||||
this.tabPage5.UseVisualStyleBackColor = true;
|
||||
this.tabPage5.MouseClick += new System.Windows.Forms.MouseEventHandler(this.tabControl1_MouseClick);
|
||||
//
|
||||
// pictureBox1
|
||||
//
|
||||
|
|
@ -437,9 +440,11 @@
|
|||
this.tb_comp.Name = "tb_comp";
|
||||
this.tb_comp.Size = new System.Drawing.Size(210, 20);
|
||||
this.tb_comp.TabIndex = 5;
|
||||
this.tb_comp.MouseClick += new System.Windows.Forms.MouseEventHandler(this.tb_comp_MouseClick);
|
||||
this.tb_comp.TextChanged += new System.EventHandler(this.cb_comp_TextUpdate);
|
||||
this.tb_comp.Enter += new System.EventHandler(this.tb_comp_Enter);
|
||||
this.tb_comp.Leave += new System.EventHandler(this.tb_comp_Leave);
|
||||
this.tb_comp.MouseCaptureChanged += new System.EventHandler(this.control_MouseCaptureChanged);
|
||||
//
|
||||
// checkControl1
|
||||
//
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@ namespace Reseter2
|
|||
{
|
||||
//private FormHistory formHistory;
|
||||
//System.Windows.Forms.CheckBox
|
||||
private System.Windows.Forms.ListBox listBox;
|
||||
private bool unSave;
|
||||
private bool FocusContext;
|
||||
private object selectItem;
|
||||
|
|
@ -30,7 +29,8 @@ namespace Reseter2
|
|||
public event saveSetting Save;
|
||||
public delegate void updateSetting();
|
||||
public event updateSetting UpdateSetting;
|
||||
|
||||
private ListBox ListComp;
|
||||
private bool listFocus;
|
||||
public Form1()
|
||||
{
|
||||
|
||||
|
|
@ -57,22 +57,19 @@ namespace Reseter2
|
|||
SGlobalSetting.LoadSetting();
|
||||
|
||||
WordsList.MainCategory = SGlobalSetting.LoadWords();
|
||||
ListComp = new ListBox();
|
||||
this.Controls.Add(ListComp);
|
||||
ListComp.LostFocus += tb_comp_Leave;
|
||||
ListComp.GotFocus += tb_comp_Enter;
|
||||
|
||||
|
||||
|
||||
// ListComp.Enter += tb_comp_Enter;
|
||||
// ListComp.MouseClick += tb_comp_MouseClick;
|
||||
|
||||
this.listBox = new ListBox();
|
||||
this.Controls.Add(listBox);
|
||||
|
||||
// this.listBox.
|
||||
|
||||
InitializeComponent();
|
||||
|
||||
this.listBox.Location = new Point(tb_comp.Location.X, tb_comp.Location.Y+ tb_comp.Height);
|
||||
this.listBox.Width = tb_comp.Width;
|
||||
this.listBox.Height = tb_comp.Height*5;
|
||||
this.listBox.Items.Add("Введите строку");
|
||||
this.listBox.Leave += tb_comp_Leave;
|
||||
this.listBox.Enter += tb_comp_Enter;
|
||||
this.listBox.Visible = false;
|
||||
|
||||
this.Save += settingWordsControl1.Save;
|
||||
this.Save += settingSCCMControl1.Save;
|
||||
this.Save += settingRebootControl1.Save;
|
||||
|
|
@ -81,7 +78,14 @@ namespace Reseter2
|
|||
this.UpdateSetting += settingSCCMControl1.UpdateSetting;
|
||||
this.UpdateSetting += settingRebootControl1.UpdateSetting;
|
||||
this.settingWordsControl1.UpdateTree = UpdateTree;
|
||||
// cb_comp.DropDownStyle = ComboBoxStyle.DropDown;
|
||||
|
||||
|
||||
|
||||
ListComp.Location = new Point(tb_comp.Location.X, tb_comp.Location.Y + tb_comp.Height);
|
||||
ListComp.Width = tb_comp.Width;
|
||||
ListComp.Visible = false;
|
||||
|
||||
//tb_comp.Controls.Add(ListComp);
|
||||
|
||||
|
||||
checkControl1.updateCheck += CheckControl1_updateCheck;
|
||||
|
|
@ -422,7 +426,8 @@ namespace Reseter2
|
|||
}
|
||||
DialogResult result = MessageBox.Show("Будет перезагруженно " + comps.Count() + " компьютеров.\nПродолжить?",
|
||||
"Запуск многопоточной перезагрузки.", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
|
||||
if (result == DialogResult.Yes) {
|
||||
if (result == DialogResult.Yes)
|
||||
{
|
||||
Reseter.AddTask(comps);
|
||||
checkControl1.set_state(false);
|
||||
CheckControl1_updateCheck(false);
|
||||
|
|
@ -560,32 +565,69 @@ namespace Reseter2
|
|||
}
|
||||
public void cb_comp_ResultUpdate(List<string> Items)
|
||||
{
|
||||
//if (Items.Count > 0)
|
||||
|
||||
// if(cb_comp.Items.Count != Items.Count) cb_comp.DroppedDown = false;
|
||||
// cb_comp.Items.Clear();
|
||||
// cb_comp.Items.AddRange(Items.ToArray());
|
||||
//cb_comp.AutoCompleteCustomSource.Clear();
|
||||
//// cb_comp.AutoCompleteCustomSource.Clear();
|
||||
//// cb_comp.AutoCompleteCustomSource.AddRange(Items.ToArray());
|
||||
|
||||
// // cb_comp.AutoCompleteMode = AutoCompleteMode.None;
|
||||
// cb_comp.SelectionStart = cb_comp.Text.Length;
|
||||
// cb_comp.DroppedDown = true;
|
||||
|
||||
// cb_comp.SelectedIndex = -1;
|
||||
|
||||
}
|
||||
|
||||
private void tb_comp_Leave(object sender, EventArgs e)
|
||||
{
|
||||
if(listBox.Focused || tb_comp.Focused) listBox.Visible = false;
|
||||
}
|
||||
|
||||
private void tb_comp_Enter(object sender, EventArgs e)
|
||||
{
|
||||
listBox.Visible = true;
|
||||
ListComp.Visible = true;
|
||||
}
|
||||
|
||||
private void tb_comp_MouseClick(object sender, MouseEventArgs e)
|
||||
{
|
||||
ListComp.Visible = true;
|
||||
System.Console.WriteLine("click");
|
||||
}
|
||||
|
||||
private void tb_comp_Leave(object sender, EventArgs e)
|
||||
{
|
||||
// System.Console.WriteLine("leav" + ListComp.Focused.ToString());
|
||||
// if (!listFocus) ListComp.Visible = false;
|
||||
//listFocus = false;
|
||||
|
||||
// if (!ListComp.Focused) ListComp.Visible = false;
|
||||
}
|
||||
|
||||
private void tabControl1_MouseClick(object sender, MouseEventArgs e)
|
||||
{
|
||||
//ListComp.foc
|
||||
// ListComp.Visible = false;
|
||||
}
|
||||
|
||||
private void control_MouseCaptureChanged(object sender, EventArgs e)
|
||||
{
|
||||
Point clickPoint = ListComp.PointToClient(Cursor.Position);
|
||||
if (!ListComp.Bounds.Contains(clickPoint))
|
||||
{
|
||||
// System.Console.WriteLine("out");
|
||||
}
|
||||
}
|
||||
|
||||
protected override void WndProc(ref Message m)
|
||||
{
|
||||
if ((m.Msg == 0x210 && m.WParam.ToInt32() == 513) || m.Msg == 0x201)
|
||||
{
|
||||
Point clickPoint = this.PointToClient(Cursor.Position);
|
||||
if (!ListComp.Bounds.Contains(clickPoint))
|
||||
{
|
||||
ListComp.Visible = false;
|
||||
}
|
||||
System.Console.WriteLine("clickers");
|
||||
|
||||
}
|
||||
base.WndProc(ref m);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -131,7 +131,7 @@
|
|||
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
|
||||
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
|
||||
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAACk
|
||||
UQAAAk1TRnQBSQFMAgEBCQEAAZABBQGQ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