CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Threaded View

  1. #1
    Join Date
    Jan 2013
    Posts
    7

    Beginner need help!!!!!

    I am doing a simple search on Richtext box, using web form application
    I created a "Search" button, TextBox and a RichtextBox
    I need to eliminate these word from user typing in the search box
    The words are
    Code:
    (the
    and
    of
    to
    that
    in
    he
    shall
    for
    unto
    i
    his
    a
    they
    be
    is
    not
    him
    them
    it
    with
    all
    thou
    was
    thy
    which
    my
    me
    but
    their
    said
    ye
    have
    will
    thee
    from
    as
    are
    when
    this
    were
    out
    by
    you
    up
    there
    then
    had
    into
    on
    one
    her
    we
    s
    your
    also
    so
    an
    if
    at
    us
    no
    do
    now
    therefore
    every
    these
    our
    or
    because
    after
    o
    may
    did
    what
    over
    who
    she
    any
    among
    thereof
    neither
    am
    should
    whom
    nor
    thus
    yet
    set
    more
    about
    how
    himself
    than
    other
    ever
    would
    without
    where
    under
    both
    been
    until
    yea
    wherefore
    toward
    well
    only
    such
    very
    between
    above
    yourselves
    cannot
    within
    whosoever
    could
    about
    above
    the
    and
    of
    to
    that
    in
    he
    for
    unto
    i
    his
    a
    they
    be
    is
    not
    him
    them
    it
    with
    all
    thou
    was
    thy
    which
    my
    me
    but
    their
    said
    ye
    have
    thee
    from
    as
    are
    when
    this
    were
    out
    by
    you
    up
    there
    then
    had
    into
    on
    one
    her
    we
    also
    your
    so
    day
    an
    if
    shalt
    at
    let
    go
    us
    do
    these
    or
    our
    say
    hast
    o
    did
    what
    who
    any
    put
    am
    two
    should
    know
    whom
    nor
    thus
    yet
    done
    saw
    how
    than
    off
    art
    three
    other
    those
    would
    first
    where
    both
    been
    yea
    wherefore
    five
    four
    whose
    being
    much
    why
    only
    such
    very
    though
    ten
    can
    therein
    known
    while
    doth
    thyself
    six
    cannot
    third
    twelve
    second
    could
    new
    knew
    wherein
    till
    here
    lo
    able
    throughout
    find
    forty
    fifty
    thence
    must
    get
    ask
    lot
    wherewith
    ought
    threescore
    tenth
    ones
    plain
    whereof
    el)
    The Code is
    Code:
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    
    namespace search_bar_w_richtextbox
    {
        public partial class Form1 : Form
        {
            public Form1()
            {
                InitializeComponent();
            }
    
            private void button1_Click(object sender, EventArgs e)
            {
                int index = 0;
                while (index < richTextBox1.Text.LastIndexOf(textBox1.Text))
                {
                    richTextBox1.Find(textBox1.Text, index, richTextBox1.TextLength, RichTextBoxFinds.None);
                    richTextBox1.SelectionBackColor = Color.Green;
                    index = richTextBox1.Text.IndexOf(textBox1.Text, index) + 1;
                }
            }
        }
    }
    If any one know how to eliminate those word from user typing,
    Can you post the full Code !!!!
    Last edited by BioPhysEngr; February 21st, 2013 at 12:32 AM. Reason: added code tags around the wordlist and fixed the bizarre huge text

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured