Reflection IT Blog

Benieuwd naar de laatste ontwikkelingen rondom software ontwikkeling en Reflection IT? Onze slimme koppen delen regelmatig hun kennis en ervaring. Zo weet jij wat er speelt!

2004 Blog posts

Dispose Modal WinForm Dialogs

12-Dec-2004

There is a difference in disposing Modal and Non-Modal forms. In a training I gave last week I noticed that even experienced developers didn't know that Modal Dialogs don't dispose automatically, Non-Modal do.

private void buttonShowNonModalForm ( object sender , System.EventArgs e){
   &nbspnew TestForm().Show();
}

privatevoidbuttonShowModalDialog(objectsender, System.EventArgs e){
   &nbspnew Form2().ShowDialog();
}

The solution to this problem is very simple by creating the Form instance within a using block. This will dispose the Form when it is closed.

private void buttonShowModalDialog ( object sender , System.EventArgs e){
   &nbspusing(TestForm f =new TestForm()){
   &nbsp   &nbspf.ShowDialog();
   &nbsp}
}

An alternative solution uses a try/finnaly. Personally I prefer the previous, it is easier to read and write.

C# HandleWhiteSpace Add-In

23-Sep-2004

The C# code editor in Visual Studio.NET 2003 does not handle whitespaces automatically like the VB.NET code editor does. This Add-In solves this problem by adding the 'Handle WhiteSpace' menu option to the Visual Studio.NET 2003 Tools menu. This option formats the C# code of the active code editor. This includes:

  • Space before:  method declaration parentheses, method call parentheses, statement parentheses, braces and brackets
  • Space after: comma and semicolon
  • Space around: operators
  • Double space

DualList Drag & Drop Component

16-Sep-2004

I have written an article two years ago with the title 'WinForm DualList Component'. In this article I mentioned the desire to extend the DualList component with Drag & Drop support. Finally it's done. Not by extending the original DualList component but by creating an new DualListDragDrop component (reason: cohesion).

Programming Drag & Drop (D&D) between listboxes is quite difficult. It requires at least 60 lines of code for every two listboxes. Therefore not many application support D&D. This component eliminates need of writing the code. You only have to set properties on it. Making it easy to support D&D in your applications.

New layout www.reflectionit.nl

30-Aug-2004

I have changed the layout of my website this weekend. A friend of my helped me with the design, thanks Loek

I'm not really finished. I still have to translate some pages to Dutch. I also want to add 'comments' to the Blog. Hope to do this soon.

Visual C# 2005 Express Edition Beta is great

14-Jul-2004

I'm testing Visual C# 2005 Express Edition Beta and I really like it. It has all of the features which I need to build Windows Forms applications. The Editor has also all new IntelliSense, Refactoring and Code Snippets features. They work great and really can boost productivity.

I have tested it on a PC with only 256Mb of ram. This is for the beta not enough. You need at least 512Mb.

I'm using the Online MSDN Help, it works OK. The looks are good but I find it difficult to get to the 'overview' of a class.

For professional development I would advise to use Visual Studio. For hobby work use the Express versions.

Second day

01-Jul-2004

After a disappointing soccer match yerterday I’m here to review the second day.

What disappoints me is that there are no sessions about Longhorn, WinFS, Xaml or Visual Studio Orca. I guess it is still so far away that it is not interesting to tell something about it. Still it is a pity. There should be new things to show after the PDC.

The overall quality of the sessions is OK, nothing special.

Tonight is the TechEd party, hope it will rock.

First Day

30-Jun-2004

This is my second day at TechEd. Yesterday was a good day. The Keynote started with a demo by a blind person (sorry I forgot his name). He demonstrated how difficult it is to surf the internet when you are blind and what we ‘developers’ should do to help him. The drum’s where very nice. It is funny to hear 6000 nerds drum. For the rest the keynote was boring.

I went to a very nice session WIN320 IIS and ASP.NET security. Not overwhelming but nice. My next session on DAT313 SQL Server 2005 Data Transformation Services was also nice. DTS has been greatly improved (at last).

The last two sessions did not really satisfy me. This could be my own fault. I was tired so I couldn’t concentrate very well.

I went to eat with my good friend Paul and some of his colleagues, Thai always good.

Today I’m going to a XP programming, InfoPath, WSE SQL 2005 session. Hope to enjoy myself. In the evening there is a big country party where we will watch the football game Portugal-The Netherlands. Hope we will win but once again I’m not very optimistic.

Get in touch

Met dit formulier kunt u informatie over een In-Company of Small-Group training aanvragen. U kunt in het bericht aangeven welke training u wilt, voor hoeveel personen, wanneer deze verzorgd moet worden en op welke locatie. Wij nemen vervolgens contact met u op.

U kunt ons ook bereiken via telefoonnummer +31 (0)493-688810 of per mail training@reflectionit.nl.