How to Move a Shape control with Mouse Events?

The Shape control in Microsoft.VisualBasic.PowerPacks provides several useful events, including MouseDown, MouseMove, MouseUp. Some useful actions you can work on a shape is to use the mouse to move or resize the shape. For example, you may want to drag an end point of a line and move the end point.  You may also want…


Building Look-Up Binding with the VS Data Source Window

About six months ago, Milind wrote a post about how to leverage the Data Source Window to build look-up binding. In that article, Milind briefly described one way to do that through drag-and-drop. In this post, I’ll show you different ways to use the Data Source Window and build look-up binding through easy drag-and-drop gesture….

Writing Event Handler for controls in a DataRepeaterItem

In the MSDN Visual Basic Power Packs forum, I had an embarrassing reply on a DataRepeater event handling question, in which the user asked why his event handling code did not work. Here is the original question: “I want to be able to resize a textbox when a user clicks on a textbox within a…


How to Workaround Sorting Errors when Updating Self-Referencing DataSet Tables with Visual Studio 2008 SP1

Hierarchical update is an important feature of typed dataset that refers to the process of saving updated data back to a database while maintaining referential integrity rules. This feature is enhanced in Visual Studio 2008 by introducing a TableAdapterManger component to manage all TableApdaters in a typed dataset. When updating related tables, TableAdapterManager uses foreign-key…


How to Change Appearance of all DataRepeater Items at Run Time

DataRepeater control is one of the most important controls in Visual Basic PowerPacks. John Chen has recently posted a great blog about this control’s background and usage. As a complement, I want to talk about how to customize DataRepeater item appearance here. Generally speaking, you could change appearance of DataRepeater items in approaches below: 1.      …


DataRepeater Control for Windows Forms

  The DataRepeater control is available in the Visual Basic Power Packs. As Yun Feng introduced in his post, the Visual Basic Power Packs is included in Visual Studio 2008 Service Pack 1 and will also be shipped in Visual Studio 2010. The DataRepeater control is my favorite component in the Visual Basic Power Packs,…


Customize format of DateTime string in WPF and WinForm data binding

Drag-and-drop data binding helps you build business applications very easily, however sometimes you still need to customize the layout or format after data binding is set. For example, I built a simple application to display all the Customers, and for each Customer, the related Orders are loaded into a DataGrid control: Of course the data…