tieuquyngok1995 / ToolSupportUchida

1 stars 1 forks source link

main7 #25

Closed tieuquyngok1995 closed 3 years ago

tieuquyngok1995 commented 3 years ago
    private void txtSearch_KeyDown(object sender, KeyEventArgs e)
    {
        bool ctrlV = e.Modifiers == Keys.Control && e.KeyCode == Keys.V;
        if (ctrlV)
        {
            tbResult.Text = string.Empty;
            int index = CommentList.LastIndexOf(txtSearch.Text.Trim());

            if (index != -1)
            {
                tbResult.Text = PropertyList[index];
            }
        }

    }

    private void btnClear_Click(object sender, EventArgs e)
    {
        this.CommentList.Clear();
        this.PropertyList.Clear();
        this.TypeList.Clear();
        tbComment.Text = string.Empty;
        tbProperty.Text = string.Empty;
        tbType.Text = string.Empty;
        tbResult.Text = string.Empty;
        lblLogicCount.Text = "0 row";
        lblPhysicalCount.Text = "0 row";
        lblTypeCount.Text = "0 row";
        lblCopy.Visible = false;
    }

    private void btnCopy_Click(object sender, EventArgs e)
    {
        if (string.IsNullOrEmpty(tbResult.Text))
        {
            return;
        }

        Clipboard.Clear();
        Clipboard.SetText(tbResult.Text);
        lblCopy.Visible = true;
    }
    #endregion