WPF animation: binding to the “To” attribute of storyboard animation

I’ve had similar situations in ControlTemplates where I’ve wanted to bind the “To” attribute to a value (rather than hard-coding it), and I finally found a solution. Quick side note: If you dig around on the web you’ll find examples of people being able to use data binding for the “From” or “To” properties. However, … Read more

How to enable design support in a custom control?

The Windows Forms designer has dedicated designer classes for most controls. The designer for a ListView is System.Windows.Forms.Design.ListViewDesigner, an internal class in the System.Design.dll assembly. This class gives you the ability to drag the column headers. A UserControl uses the System.Windows.Forms.Design.ControlDesigner designer class. It doesn’t do anything special, just puts a rectangle around the control … Read more

Does anyone know of a low level (no frameworks) example of a drag & drop, re-order-able list?

heh I hate frameworks so this is easy as pie for me… this is what I coded for my students during my lectures few years back: http://ulozto.net/x2b7WLwJ/select-drag-drop-zip This is the main engine code (complete project + exe is in that zip above): //————————————————————————— //— Constants: ———————————————————— //————————————————————————— const int _select_max_l=16; const int _select_max_ll=_select_max_l*_select_max_l; const int … Read more

“The Controls collection cannot be modified because the control contains code blocks”

First, start the code block with <%# instead of <%= : <head id=”head1″ runat=”server”> <title>My Page</title> <link href=”https://stackoverflow.com/questions/778952/css/common.css” rel=”stylesheet” type=”text/css” /> <script type=”text/javascript” src=”<%# ResolveUrl(“~/javascript/leesUtils.js”) %>”></script> </head> This changes the code block from a Response.Write code block to a databinding expression. Since <%# … %> databinding expressions aren’t code blocks, the CLR won’t complain. Then … Read more