Posts Tagged ‘WPF’

Handling events from within a ControlTemplate in WPF

Here’s an interesting one that had me stumped for a few hours.

Following on from my previous post, where I explained how to create a ControlTemplate to style a TextBox in WPF, I’ve got an object, TextEntryBox, which dervies from a TextBox (it provides some custom event handlers when text is entered, but to all intents and purposes, it’s a regular TextBox).

I wanted to style my TextEntryBox, this time including a button within my ControlTemplate (this will eventually toggle an on-screen keyboard pop-up, but that’s another blog post!). I came up with this:
Read the rest of this entry »

Tags: , , , , , , , , , , ,

1 Comment


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:


Tags: , , , , , , , , , ,

No Comments


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!)

Tags: , , , , , , , , , , , ,

No Comments



SetPageWidth