Overriding Events in VB.NET

Back in the day, you use to be able to override an event in VB by using the drop down list in the code window.  Today, I had a friend who is moving from Visual Studio 2003 to Visual Studio 2008 ask me, “How do I override events in VB.NET now?”  All you get in the drop downs now is the event handlers.

(more…)

If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!

Thursday, May 8th, 2008

WinForms - Database Changes not sticking.

Saturday afternoon I spent trying to get a Windows Forms application to add data to a database.  It all seemed to work correctly.  Add changes, no errors.  Close window, open window.  Yep changes are there.  Close application, re-run application.  Yep, changes still there.  Make a change to the code, re-run.  No data.

(more…)

Monday, April 28th, 2008

UnauthorizedAccessException writing to HKLM

Q. I’m trying to write to HKLM on a Vista computer using the following code:

Dim k As Microsoft.Win32.RegistryKey
k = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(“software”, True)
k = k.CreateSubKey(“subkey1\testprogram”)
k.SetValue(“foo”, “bar”)

But, when I get to the last line, the UnauthorizedAccessException is thrown.  How do I fix this?

(more…)

Tuesday, April 8th, 2008