Many times while designing the layout for a Form, I will use Panels docked to various positions, with controls docked fill inside them. On occasion, for reasons previously unknown to me, the Panels would just not dock the way I wanted them to. Things usually go off without a hitch when the entire layout is done at once, but the “problems” start introducing themselves when altering an existing layout or adding Panels. Today, the light bulb finally went off and the mystery of the Dock property is no more. It turns out, as many of you may or may not know, the weight of the docked items are determined by their Z order on the Form. In short, preference starts with the bottom-most control and goes up the chain.
Read the rest of this entry »
February 10th, 2008 | Posted in Tips & Tricks, Visual Studio | No Comments
There seems to be a lot of issues when dealing with writing Office Add-ins. Forums are scoured with posts regarding an add-in that works fine on one PC but fails to load on another. The most common reason is simply described as "a run time error" by the COM add-in’s dialog. Thank Microsoft for the uber-description on that one. After a lot of time and debugging, I believe I have finally tracked down a solution to these problems. The problem is a bug in Visual Studio 2005 (not sure about 2008) that omits some prerequisites. Read on for the solution.
Read the rest of this entry »
December 20th, 2007 | Posted in Add-Ins, Interoperability, Legacy, VSTO | No Comments
It’s been a while since my last posting, and I according to my site stats, my 4 readers must be getting impatient for new material. Recently I got an HTC 8525 PocketPC. Now, I use personal folders in Outlook, so all of my calendar appointments are in there and not on the Exchange server. Being that ActiveSync is created by MicroSloth, we’re at version 4 and still do not have the ability to specify where we are synching to, for users with multiple data files. After quite a lot of searching, I found a number of applications to synch my local calendar with the server, but all were shareware or quite flaky actually. So, when in need, roll your own!
Read the rest of this entry »
November 29th, 2007 | Posted in Outlook, VBA | 1 Comment
In many projects I am finding that I am quickly growing tired of writing delegates to keep various controls thread safe in multi-threaded environments. I have not yet determined whether it is best to create separate utility classes to handle all of the non-thread safe functionality, or to extend the control itself to be thread safe by default. While writing this sample, and seeing how incredibly simple it is to make a control thread safe, I am baffled as to why Microsoft did not build this in from the start.
Read the rest of this entry »
November 12th, 2007 | Posted in C#, Threading | No Comments
Yes you read that correctly. I have had this class laying around for a while and finally decided to finish it up, write an article about it, and make it publicly available. I did a LOT of searching and turned up absolutely nothing in the way of implementing Google Bookmarks, so I give you a world premier here!
Read the rest of this entry »
November 12th, 2007 | Posted in C#, Interoperability | 1 Comment
Remember Mailslots? I do! I do! Gohd, I do..
Back in the day I used Mailslots to create a very simple LAN chat program in Delphi. Now I have re-created that functionality for use in .NET. Here I have a fully working Mailslot control written in C#.
This is one of those technologies that seriously needs to be re-vamped, but while it’s here, let’s use it! What are Mailslots you say? Well… Basically a form of communication between 1 or more computers over UDP. Mailslots are in the form of \\Domain\[MachineName][*]\the\desired\path\to\the\slot.
Read the rest of this entry »
November 12th, 2007 | Posted in C#, Legacy | No Comments
In a recent project I found the need to be able to drop an image from Internet Explorer onto my form and capture the URL of the image. If you have tried using any of the text formats to get the drop data then you know this does not work. At best you will get the locally cached path of the image file. There is little or no documentation o¬n the subject, and attempting to search for information only yields others seeking the same answers. This is why I decided to make this an article. Note that this code makes use of regular expressions. As this is not an article about regex’s, which is a huge topic in itself, I provide no explanation of the expressions used. You can easily find numerous tutorials on Regular Expressions.
The key to reading the source URL of the image is in the data type. Through much trial and error, I found that the magic words are "HTML Format", as you will see.
Read the rest of this entry »
November 12th, 2007 | Posted in C# | No Comments