No longer updated: new and updated blog (including old content) at

Archive for, please update your bookmarks

Posts Tagged ‘tips’

Quick Tips: C# inline event handlers and Reordering method / constructor parameters

Posted by Roy Triesscheijn on Thursday 15 October, 2009

I always hate having to write an extra method to deal with event handlers and today it irritated me more than ever. The extra event handlers all consisted of just one line of code, it’s also harder to read what is going on if you have to scroll down all the time to check what that event handler is doing.

So today I finally typed in “C# inline event handlers” in Google. And the first website I clicked already gave me what I was looking for. Apparently this was added in C# 2.0 and it basically boils down to this:

this.button1.Click +=
  delegate(object sender, EventArgs e)
  {    MessageBox.Show("Test");   };

Quick easy and very handy!

Another thing that I found out recently is that you can easily reorder method and constructor parameters using Visual Studio 2008’s built in refactoring tools. All you have to do is right click the method/constructor and select Reorder parameters. Very easy and very handy. Just the kind of trick you have to know that is there to be able to use it.

Reorder context

You’ll get a nice form which allows you to reorder your parameters, Visual Studio will automatically update all callers.

Of course these are all tips that are simple and are well documented on the internet, if you look for them,  but maybe I’ll make a few of you guys happy with these.


Posted in Blog, General Coding, Tips | Tagged: , , , , , , , , | 4 Comments »

Windows Tip: tileing multiple windows

Posted by Roy Triesscheijn on Wednesday 15 October, 2008

I’m still amazed how many people dont know this little trick, but it makes your life allot easier when you are working with 2 or more documents on one screen. (For some goodness when using a dualmonitor setup, Nvidia users can use nView for free, other people should have a look at ultramon)

For example if your working with 2 config files, a reference file and your own file, you want to see them both at the same time. Open both files in your favourite editor, say notepad. Now go to the taskbar and select both instances while holding the ctlr key now press the rightmousebutton and select one of the options (Tileing, cascade, minimize all etc..)

The context menu

And here you are 2 windows perfectly aligned next to each other (this also works for more windws, and different apps mixed togheter).

And yes, I know its a small thing but if you didn’t knew it yet it’s sure handy!

Posted in Windows | Tagged: , , | Leave a Comment »