July 16, 2004

Synchronize Color Changes Between Controls in a Windows Form

This tip shows how binding Windows Forms controls to each other can reduce the code and logic needed to synchronize color changes between controls in a Windows Form. This technique can also be used to implement ‘themes’ for Windows forms. CODE EXAMPLE: Keep the BackColor of three Button’s sychnronized through

How to Force a Browser to Display a “Save As/Run from Location” Dialog

Today, most browsers are designed to handle the known mime types in a very user-friendly manner. For example, if a server program writes an image/jpeg as a mime type, the browser will open the registered image viewer to display the contents. This would be true for any registered mime type

How to Use an XPath on a DataSet

This small snippet shows how to use a XPath on a DataSet. Here are the used classes: DataRowDataSetXmlDataDocumentXmlNodeListXmlNode Here’s the XML file: One Three Four Two Finally, here’s the code: DataSet ds = new DataSet();ds.ReadXml(Server.MapPath(“file.xml”));XmlDataDocument xmlDoc = new XmlDataDocument(ds); XmlNodeList nodeList = xmlDoc.DocumentElement.SelectNodes(“/CategoryList/Category[@ID=01]”); DataRow myRow;foreach (XmlNode myNode in nodeList){ myRow

Enforce Custom Password Policies in Windows

icrosoft Windows allows you to define various password policy rules. Specifically, it allows you to enable the “Password must meet complexity requirements” setting using the Policy Editor. This validates user passwords against password filter(s) (system DLL(s)). Usually, people use the default filter. However, many admins say they’d prefer a Linux-style

Test Drive Test-Driven Development with Visual Basic 6

gile development is the new paradigm! (Are you rolling your eyes yet?) Yes, “paradigm” is an overused word but hype aside, agile development does offer some interesting best practices that might turn on its head how you think about developing software. One such practice is test-driven development (TDD), which has