Dutton's blog

How to create a ControlTemplate for a WPF TextBox

This is a short post, but has one specific piece of information I want to keep.

Q: If you want to create a ControlTemplate to provide a custom style for a TextBox, how do you specify where the text goes when it's used in WPF?

A: The answer was hidden in the depths of the MSDN Documentation. You have to include a <ScrollViewer> within your ControlTemplate with an x:Name value of "PART_ContentHost".

Here's a noddy example:


My New Project!

Happy New Year everyone!

To celebrate 2010 in style, I'm launching a 365 Photography Project.

It's got it's own blog and I'll be posting photos to my flickr stream and to the blog every day so please check it out!

First post.... tomorrow! =) Hang-over or no hang-over.....

Right, let the festivities commence!

My First Photobook Online!!!

After a few weeks of fiddling with Blurb's excellent BookSmart app, I've finally finished my first photobook.

The book covers my best shots taken between 2006-2009 and so pretty much plots the development of a serious photography addiction for me, from the early 350D days, right up to the most recent Cornwall trip and Low Light Photography Course I attended last month (yes, blog post LOOONG overdue for that one, it's on its way. The photos are just hitting my flickr now and over the next few days!)

A collection of my...
By Richard Dutton

Please feel free to drop by and have a look, all of the photos are from my flickr stream but I thought it was about time to have something in print.

Blurb's software has come on in leaps and bounds since the last time I tried them out a few years ago. With a version for both Mac and Windows users, it provides not only the standard templated layouts, but also the ability to tweak and create your own layouts from scratch, something which I felt was missing from the original version.

I've got a printed copy on its way and will report back as soon as it arrives.

Mozilla 1 - Microsoft 1

Add-ons may be causing problemsAfter silently installing their own add-ons to Firefox earlier this year as part of a Microsoft Service Pack, it appears that last last week Mozilla finally got around to blocking them on security grounds.

While Microsoft are happy modifying and 'updating' other people's software in one of their updates, they then seem a bit lapse in keeping on top of the ol' bug fixeroo, one of the primary reasons people flee from IE in the first place.

Prior to Mozilla blocking them, it turns out that this particularly nasty 'Critical Remote Code Execution' vulnerability applied not only to IE, but to Firefox installs containing these add-ons. So thanks guys, I'm glad someone's watching our backs! =)

(Now, who knows what this will do to my WPF XBAP testing? After all that I might have to dust down IE!)

Google Wave Preview

Google Wave Preview InvitationGot my Google Wave invite through this morning, guess I need to RTFM and figure out exactly what it is/does as it all seems a little empty at the moment. Probably not helped by the fact that I don't have any contacts using it either! Hmmm a one-man collaboration tool? About a useful as a chocolate teapot methinks! Got 6 invites left if anyone wants one?