1688商品采集
This commit is contained in:
1 parent
53736cff6e
commit
c489c30bf1
35 files changed
+4095
-254
No files matched your search
@@ -39,6 +39,7 @@ namespace TemuKJD.UserComponent
|
||||
}
|
||||
}
|
||||
|
||||
Label lblX = null;
|
||||
CheckedListBox checkedListBox = null;
|
||||
public UcComboBoxMutiSelect()
|
||||
{
|
||||
@@ -52,6 +53,80 @@ namespace TemuKJD.UserComponent
|
||||
this.DropDownHeight = 1;
|
||||
this.DropDown += UcComboBoxMutiSelect_DropDown;
|
||||
this.DropDownClosed += UcComboBoxMutiSelect_DropDownClosed;
|
||||
|
||||
Task.Run(() =>
|
||||
{
|
||||
for (int i = 0; i < 50; i++)
|
||||
{
|
||||
System.Threading.Thread.Sleep(100);
|
||||
var parentForm = FindForm();
|
||||
if (parentForm != null && parentForm.Visible == true)
|
||||
{
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
UpdateClearLabel();
|
||||
}));
|
||||
break;
|
||||
}
|
||||
}
|
||||
this.Move += UcComboBoxMutiSelect_Move;
|
||||
this.Resize += UcComboBoxMutiSelect_Resize;
|
||||
this.SizeChanged += UcComboBoxMutiSelect_SizeChanged;
|
||||
});
|
||||
}
|
||||
|
||||
private void UcComboBoxMutiSelect_SizeChanged(object sender, EventArgs e)
|
||||
{
|
||||
UpdateClearLabel();
|
||||
}
|
||||
|
||||
private void UcComboBoxMutiSelect_Resize(object sender, EventArgs e)
|
||||
{
|
||||
UpdateClearLabel();
|
||||
}
|
||||
|
||||
private void UcComboBoxMutiSelect_Move(object sender, EventArgs e)
|
||||
{
|
||||
UpdateClearLabel();
|
||||
}
|
||||
|
||||
private void UpdateClearLabel()
|
||||
{
|
||||
if (lblX == null)
|
||||
{
|
||||
lblX = new Label();
|
||||
lblX.Click += LblX_Click;
|
||||
//lblX.BorderStyle = BorderStyle.FixedSingle;
|
||||
lblX.Text = "×";
|
||||
lblX.ForeColor = Color.FromArgb(63, 126, 255);
|
||||
lblX.BackColor = this.BackColor;
|
||||
lblX.AutoSize = false;
|
||||
//lblX.AutoSize = true;
|
||||
//lblX.Width = 17;
|
||||
lblX.Width = 15;
|
||||
lblX.Height = 19;
|
||||
lblX.SendToBack();
|
||||
Form form = this.FindForm();
|
||||
form.Controls.Add(lblX);
|
||||
}
|
||||
Point relativeLocation = this.GetRelativePosition();
|
||||
//lblX.Location = new Point(relativeLocation.X + this.Width - 19 - lblX.Width, relativeLocation.Y + (this.Height - lblX.Height) / 2);
|
||||
lblX.Location = new Point(relativeLocation.X + this.Width - 19 - lblX.Width, relativeLocation.Y + (this.Height - lblX.Height) / 2);
|
||||
lblX.BringToFront();
|
||||
}
|
||||
|
||||
private void LblX_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (this.lblX.Text == "×")
|
||||
{
|
||||
this.lblX.Text = "↶";
|
||||
this.Text = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
this.lblX.Text = "×";
|
||||
this.Text = "全部";
|
||||
}
|
||||
}
|
||||
|
||||
private void UcComboBoxMutiSelect_DropDownClosed(object sender, EventArgs e)
|
||||
|
||||
Reference in new issue
Block a user