private void btnSearch_Click(object sender, EventArgs e) { DialogInlineSearch ds = new DialogInlineSearch(); ds.SetBounds(this.btnOK.PointToScreen(Point.Empty).X - 15, this.btnOK.PointToScreen(Point.Empty).Y - 15, ds.Bounds.Width, ds.Bounds.Height); if (ds.ShowDialog() == DialogResult.OK) { this.FindingMatchSearchKeyword(ds.keyword); } }
protected override void OnKeyPress(KeyPressEventArgs e) { if (e.KeyChar == (char)Keys.Back) { base.OnKeyPress(e); return; } if (((char)e.KeyChar).ToString().Trim().Length > 0) { DialogInlineSearch ds = new DialogInlineSearch(((char)e.KeyChar).ToString()); ds.SetBounds(this.btnOK.PointToScreen(Point.Empty).X - 15, this.btnOK.PointToScreen(Point.Empty).Y - 15, ds.Bounds.Width, ds.Bounds.Height); if (ds.ShowDialog() == DialogResult.OK) { this.FindingMatchSearchKeyword(ds.keyword); } } }