January 2004 - Posts
Test Driven .NET Blog
is fun, fun, fun, there's a new unit test challenge there now, pretty easy, but it's cool.
The kind of systems and applications I normally develop are browser-based, but now and then I try my luck at Windows Forms. Right now I'm doing this little instant messaging program, a pretty simple chat that communicates with a server via SOAP. Anyways, I'm having this battle with a RichTextBox I'm using in a form to display chat messages, smilies and such. Explain this to me: When the RichTextBox is designed to be anchored to the bottom of the form, whenr I add text to it while it's minimized in the task-bar, it refuse to scroll down to the end/bottom of the RichTextBox. The effect is that when I bring up the form from the task-bar and look at it, no messages are displayed until I tap once on the vertical scrollbar! Very amazing and feels like a bug. It doesn't matter how much I try to use the ScrollToCaret() method or other tricks, if the RichTextBox has the anchor property set to bottom, ScrollToCaret() doesn't work as it should.
I think I'll have to subclass the RichTextBox and send my own scroll-messages to it to make this work. :(
For some strange reason the MeasureItem event isn't fired when an owner drawn listbox (or similar control) is resized. If you have lots of items in the listbox with variable height, for example text that needs to wrap, this becomes a problem. I tried different stuff to fix this, but it seems that the MeasureItem event is only fired when things are added or removed from the listbox, so the simplest fix was this:
listBox1.Resize += new System.EventHandler(listBox1_Resize);
private void listBox1_Resize(object sender, System.EventArgs e)
private void RefreshListBox(object sender)
ListBox listbox = (ListBox)sender;
object items = new object[listbox.Items.Count];
Take a copy of the current items in the box, remove the items and just add them again. Stupid, but as far as I know, this has to be done if you want the correct item height.
Peter Golde blogs this:
I was very happy to discover that it is trivial to get NUnit 2.1 to work with the Whidbey version of the .NET runtime. If you have the PDC release, you just need to do the following:
First, create a new NUnit directory (say, "NUnit Whidbey") and copy everything from your Program FilesNUnit V2.1 directory over to the new directory. Second, open the two files "bin\nunit-console.exe.config" and "bin\nunit-gui.exe.config" inside a text editor. Right above the other lines that start with "supportedRuntime", add the following line:<supportedRuntime version="v1.2.30703" />
After that, NUnit runs just fine with Whidbey, and you can test code that uses Whidbey-only features.
The place I'm working at for the moment stops Messenger in their firewall due to some security reason or other. Is Messenger really that dangerous? I've heard about some kind of trojan virus or other that could affect Messenger, but come on! I tried to configure Messenger to use HTTP proxy but it seems to fail. It's probably turned off in the firewall as well (unless someone out there knows how to get it working).
Anyway, I'm desperate to be able to chat with my old pals, so I'm thinking of rolling my own simple chat program, which uses a chat-server implemented as a web service, and throw the client at my pals... I've been without Messenger for almost 3 months now... must...chat...now...
Here's a couple of nice videos showing off Longhorn features. Someone might have missed them, so... First there's the Commercial Real Estate concept video, which shows off a few cool Avalon graphics stuff. Then there's a pretty long MSDN TV episode called "A Lap around Longhorn" with Don and ChrisAn that is quite nice. It shows some XAML/Longhorn/Avalon/Indigo code. That show was posted some time ago, but it's still nice.
A year or so ago I got the MCAD/MCSD self-paced training kits from MS Press to do the test exams. I've been through 12-13 of the questions now and I've seen an embarrassing number of errors so far. Code snippets with obvious errors that would never compile etc. etc. Right now I'm looking at a question about settings in web.config with 4 answers, and all of them are wrong! Amazing...
This practice test cannot have gone through any review whatsoever by someone who really knows ASP.NET :(
I watched a few of the streamed Indigo presentations from the PDC the other day. I got a good grip of the basics of what Indigo brings now, even though I think the presentations I saw wasn't really up to the standards.
The best way to prepare for Indigo seems to be to use ASMX and ES (Enterprise Services) inside the ASMX methods if you really need ES features like automatic transactions. I got the feeling that Don and the Indigo guys recommeded to stay away from .NET Remoting and I don't have a problem with that :)
The peer-to-peer stuff in Indigo looks really nice, and I will sure test them out once I get my hands on the libraries needed.
First day at work after 2 weeks off... I need coffee!!