Highlighting certain letters within a string, like in a filtered Contacts list

  • Thread starter Thread starter Minerva Jones
  • Start date Start date
M

Minerva Jones

You know how when you're filtering your contacts list on your Windows
Mobile device by typing in part of the name, and the list highlights
the characters within the names to show you how it matched? I'd like
to do that within the CF. Now I realise I could jump through a few
hoops and implement it myself, but if there's something already out
there, an example, a control, an idea, that I should perhaps consider
first, then I'd like to know! I figure I need to
borrow/steal/implement a text box which can take a string array of
phrases to highlight within the main text.

Any ideas?

Thanks
 
I've written code that does this, see:

I've built a set of utility classes and UI widgets for Windows Mobile
in a project called Roam. The code is available on SourceForge and
open sourced under BSD. http://www.sourceforge.net/projects/roam. The
particular classes that you want to look at are KeyFilteredListBox.cs
and TextBoxFilteredList.cs. You're welcome to incorporate Roam into
your project or just copy/paste code from it.

Jon
 
I've written code that does this, see:

That's exactly the sort of thing I need to implement!

I've built a set of utility classes and UI widgets for Windows Mobile
in a project called Roam. The code is available on SourceForge and
open sourced under BSD. http://www.sourceforge.net/projects/roam. The
particular classes that you want to look at are KeyFilteredListBox.cs
and TextBoxFilteredList.cs. You're welcome to incorporate Roam into
your project or just copy/paste code from it.

Wow! Cheers Jon, that's a great looking project! I had a look at the
two files you mentioned, but couldn't find what I needed. I tried to
figure out how to download the entire source so that I can look
through it (I figure finding all references to SelectedForeColor or
SelectedBackColor would help, but it's really tricky to do that with
the HTML interface. I couldn't find anywhere to download the whole
source though?

Thanks
 
Wow! Cheers Jon, that's a great looking project! I had a look at the
two files you mentioned, but couldn't find what I needed. I tried to
figure out how to download the entire source so that I can look
through it (I figure finding all references to SelectedForeColor or
SelectedBackColor would help, but it's really tricky to do that with
the HTML interface. I couldn't find anywhere to download the whole
source though?

Although I'd still be interested in the source, I have found what I
needed to see, which was GraphicsUtils.Find. It seems that it does
have to be done by hand, using lots of MeasureString calls as I'd
originally planned out. Maybe I'd hoped too much that there'd be a
simpler way (I thought perhaps a HTML text control that I could simply
insert tags into the string). So I'll continue to develop my
MeasureString version. Thanks for your help and, nice project!
 
Minerva,

Yah, I've actually experimented doing this with HTML as well (it would
certainly make this endeavor much simpler). I don't believe, however,
that the .NET CF has a rich text control. Also, as I mentioned before
you're welcome to use any part of Roam in your project or simply view
the code for reference :)

Best of luck,

Jon
 
Back
Top