Hi,
How can I compare two strings so that I get the best match.
I have made form1 with two panels.In the upper panel there is a textbox in which user can enter any string and now I want to compare this string with the text property of other forms (form2,form3 etc....).
If string matches completely with the text property of any particular form then it should display that form on lower panel in form1 . and if it does not matches , then it should display error in messagebox.
How can I do this........
Loading
Danatas GerviPosted Aug 25, 2009, 11:33 AM
Created (by new operator) and not showed yet?
If your forms are existing in main form collection (MDIChildren for example) - create a handler for event TextChanged for your textbox:
private void textBox1_TextChanged(object sender, EventArgs e)
{
foreach (Form chForm in MdiChildren)
{
if (chForm.Text == textBox1.Text)
{
chForm.Activate();
}
}
vinni jainPosted Aug 25, 2009, 12:38 AM
I am entering the string in textbox and if it exactly matches with the text of any of the forms then that form should open in the lower panel.
Roei BarPosted Aug 24, 2009, 4:03 PM
specific TextBox Items on forms?
i need some more data in order to provide the right code