Finding what you need in the Microsoft® Visual Studio® 2005 documentation, which has over 45,000 topics, can be a daunting task. The Doc Detective is here to help, utilizing his investigative skills to probe the depths of the documentation.

Can’t find what you’re looking for? Just ask- if it’s in there, I’ll find it for you; if it isn’t, I’ll let you know that as well (and tell you where else you might go to find it).

Have a question for the Doc? Send your questions for future columns to me at

Dear Doc Detective,

I have written several functions in Visual Basic .NET that I reuse again and again. Other than importing modules, copying and pasting, etc., does Visual Studio have some sort of tool that I don’t know about to make these readily available to any new apps?

- Recycling in Reston

Dear Recycling,

Visual Studio 2005 has a new feature called IntelliSense Code Snippets that provide a great solution for code reuse without the need for referencing class libraries. Code snippets are easily accessed from the Code Editor via an Insert Snippet command on the context menu.

The topic "Visual Basic IntelliSense Code Snippets" is a good introduction to code snippets and how to use them.

Even better, you can create your own code snippets, automatically making your functions reusable in any new project that you create. You can even make your functions customizable by using literals. For an example, see "Creating Code Snippets".

The code snippets are stored as XML, so you can easily share them with others-see "How to: Share Snippets with other Developers."

- Doc D

Dear Doc Detective,

I’ve designed a splash screen that displays when my application launches. The problem is that it only displays for a split-second before launching into my main form.

How can I delay the splash screen to display for say five seconds before launching into the actual main form?

--Blinking in Bloomington

Dear Blinking,

When you add a splash screen at design time in the Visual Studio 2005 Project designer, the default display time is 2000 milliseconds (2 seconds). Of course, if the main form takes longer than 2 seconds to display, the splash screen will stay up until the form is loaded.

You can override this by setting the MinimumSplashScreenDisplayTime property in the My.Application namespace, which takes an integer to specify the number of milliseconds to display the splash screen. The code would look something like this:

Me.MinimumSplashScreenDisplayTime = 5000

The topic "My.Application.MinimumSplashScreenDisplayTime Property" has an example of how to change the display time by overriding the OnInitialize method of your application.

Be careful not to set the delay to a really high value-you don’t want your users to fall asleep waiting for your app to start.

- Doctor D

Dear Doc Detective,

We are using a migration approach whereby we are only migrating small pieces of the application at one time, and using COM interop to handle the integration until all of the pieces are migrated.

One of the pieces that has been migrated needs to be able to drag and drop onto a form containing a Visual Basic 6 User Control that is using OLEDragDrop internally.

Is there any way to get the drag and drop to work between Visual Basic 6 and .NET?

- Dragging in Dresden

Dear Dragging,

I hate to drag you down, but I don’t know of any way to make the two work together. Visual Basic 6 drag and drop (specifically OLE drag and drop) is quite different than .NET drag and drop.

There is a great article that discusses the differences: “Drag and Drop Changes in Visual Basic .NET.”

That said, it might be simpler to migrate just the Visual Basic 6 user control and consume the Visual Basic .NET version of the control in your Visual Basic 6 application. Then drag drop will work using the .NET model.

The obvious problem with this solution is that you would need to roll out an updated version of Visual Basic 6 application that now consumes the managed control. It’s unclear from your description if that would be feasible.

- the Doc

Yo, Doc Detective Dude,

I noticed in the May/June 2005 issue of CoDe Magazine that all of the questions were from relatively obscure cities in the greater Los Angeles area (except for Menlo Park, which is an obscure city in the Bay Area). This got me to wondering: Is this in fact just an amazing coincidence, or is a more sinister hand at work here? Do most of your correspondents invent cute, alliterative names incorporating their place of residence, or do you make these things up yourself?

- Wondering in Westminster (a really obscure Southern California city)

Dear Wondering,

You caught me! It’s a little known fact that CoDe Magazine is only read by readers from relatively obscure cities in the greater Los Angeles area (and one from Menlo Park).

Okay, I’m kidding. In reality, I make up the names and cities to protect the innocent (except in your case - oops!) I didn’t realize that I had used all Southern California cities in that particular issue-I did visit L.A. not long before I wrote that column, so perhaps it was a subconscious thing.

- Doc Detective Dude

Doc’s Doc Tip(s) of the Day

Searching for help in Visual Studio 2005 has just gotten a lot more powerful.

The Search function in Help allows you to search not only in the local Help system, but also in the MSDN Online Library and in the Codezone community, a collection of online resources for Visual Studio. The MSDN Online Library may contain newer versions of Help topics, as well as articles that aren’t in the documentation; the Web sites that make up the Codezone community contain helpful information from many Visual Studio experts.

Note that to access the MSDN Online Library and the Codezone community, you must have an active connection to the Internet and any proxy server or firewall must be configured to allow access. In addition, your Help settings must be configured for online access. For more information, see the topic "How to: Include Online Content in Search and F1 Help Results".

Found a topic in Help that doesn’t help? Tell the Visual Studio documentation team about it at