|
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace DemoApp
{
public delegate void FindInPage(string FindPhrase,bool MatchWholeWord,bool MatchCase, bool Downward, bool HighlightAll, string sColor);
public partial class frmFind : Form
{
public event FindInPage FindInPageEvent;
public frmFind()
{
InitializeComponent();
}
private void frmFind_FormClosing(object sender, FormClosingEventArgs e)
{
if (e.CloseReason == CloseReason.UserClosing)
{
e.Cancel = true;
this.Hide();
}
}
private void btnClose_Click(object sender, EventArgs e)
{
this.Hide();
}
private void btnFind_Click(object sender, EventArgs e)
{
if (FindInPageEvent != null)
{
FindInPageEvent(txtFind.Text, chkMatchWholeWord.Checked,
chkMatchCase.Checked, ((radioBtnDownward.Checked) ? true : false),
chkSearchAndHighlightMatches.Checked, comboColors.Text);
}
}
private void frmFind_Load(object sender, EventArgs e)
{
comboColors.SelectedIndex = 0;
}
private void txtFind_KeyUp(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
e.Handled = true;
if (FindInPageEvent != null)
{
FindInPageEvent(txtFind.Text, chkMatchWholeWord.Checked,
chkMatchCase.Checked, ((radioBtnDownward.Checked) ? true : false),
chkSearchAndHighlightMatches.Checked, comboColors.Text);
}
}
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.