Snaplines: Using CTRL Key to Snap in Windows Forms

I was just in a meeting and learned about a Windows Forms feature I previously knew nothing of. I love Snaplines in Windows Forms 2.0/Visual Studio 2005. What I didn’t know, however, is that you can use the CTRL key and the arrow keys to snap to Snaplines. Try it! Place a Panel and a…

1

Control.Location is a Pain – or, Why We Need an OffsetLocation() Method

I’m polishing up some code for a Windows Forms white paper on application layouts in Windows Forms 2.0. The paper will cover advanced uses of the ToolStrip control for creating navigational layouts, among other things. One of the samples is a VS Toolbox-style flyout panel. The code to implement this wasn’t too gnarly, except that…

0

Using TableLayoutPanel to Create DHTML-Style Text Menu

I’m not a big fan of TableLayoutPanel. The control is very limited in what it can do given that the cells created by column/row interactions are not programmatically accessible (unlike in DHTML tables or even in the awesome DataGridView class). However, you can still pull off some cool tricks in spite of its limitations. Below…

0

Using ToolStrip as a TabControl Alternative in Windows Forms

I’ve been going back and forth lately with Karl Erickson, another member of our team, and the guy who owns the TabControl docs. It appears that my gripes with TabControl weren’t mine alone. He’s been fielding reports of various weird bugs, such as the visual styles weirdness and the funky way TabControl handles layout at…

1

Windows Forms TabControl: Using Right-Aligned or Left-Aligned Tabs

I wanted to do something today that I thought was simple: take a Windows Forms TabControl and render the tabs horizontally on the right- or left-hand side of the form. The good news is, it is simple. You just have to know the secret sauce to pull it off. On TabControl, set the following properties: .Alignment=Right…

3