Ask the Doc Detective: Background Apps and More

Ask the Doc Detective: Background Apps and More

an’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 [email protected].

Dear Doc Detective,

I’m designing an application that will run primarily in the background without user intervention. I want to put a little icon on the taskbar that the user can double-click to open a configuration dialog box?something similar to the Windows? Update icon. I’ve searched the index under “icons” and “taskbar,” but I can’t seem to find anything telling me how to do this.

? Stumped in Stamford

Dear Stumped,

It’s just a matter of terminology?you are supposed to know that the taskbar has a “notification area” and the icon is called a “notification icon.” From there you should just naturally understand that what you need is a NotifyIcon component. Never mind that it’s indexed under “system tray,” which is the unofficial name for the notification area. Clear as mud, right?

The topic “Adding Application Icons to the Taskbar with the Windows Forms NotifyIcon Component” should get you started.

The one thing that the topic doesn’t discuss is how to get rid of the icon once your dialog closes. You will need to set the NotifyIcon component’s Visible property to false in the form’s Closing event, otherwise the icon will remain in the system tray.

Now, as for the icon itself?I would gladly supply you with a picture of the good Doc that you could use….

Doc D

Dear Doc Detective,

I’ve created an ASP.NET server control by following the steps in the walkthrough on creating a custom Web control. It works just fine, but now I’m ready to share my control with my coworkers. I want to allow them to set properties for the control in the Properties window at design time. How do I do this?

? Propertyless in Providence

Dear Propertyless,

Real programmers set properties in code, not in the Properties window. That said, adding Property window support for your ASP.NET server control is easy?it just isn’t covered very well in the documentation.

There is, however, a recent article on MSDN ( that covers this as well as other related subjects such as adding IntelliSense? support for your control. Just search the library for “Adding Design-Time Support to ASP.NET Controls.”

For those that are looking for an introduction to ASP.NET server controls, the aforementioned walkthrough is a good starting point. Just look for the topic “Walkthrough: Creating a Web Custom Control.”

Doctor D

Dear Doc Detective,

I’m in the process of upgrading a VB 6 application to VB.NET. During the upgrade, my drag and drop code wasn’t upgraded, but I found a topic that showed me how to implement drag and drop in VB .NET. The problem is, my old application supported dragging multiple items from one ListBox to another. When I try this in VB.NET, the MouseDown event invalidates the multiple selection. I could do this in VB 6 , so why doesn’t it work in VB .NET?

? Clueless in Cleveland

Dear Clueless,

That’s a real drag! Admittedly, once you get beyond the basics of drag and drop, the Visual Basic documentation isn’t much help. What the docs don’t tell you is that you should use a ListView control instead of a ListBox. The ListView control has an ItemDrag event, which can be used instead of the MouseDown event, allowing you to drag multiselected items.

There is a recent article on MSDN that demonstrates dragging and dropping between ListView controls, as well as several other advanced drag and drop techniques. Just look for “Implementing Drag and Drop in Visual Basic .NET,” and soon you’ll be dragging ’til you drop.

? the Doc

Doc’s Doc Tip of the Day
In Visual Studio .NET, when you press F1 to get Help, the Help topic shows up in the IDE in a docked window. To make it easier to read Help while working, you can undock the window in various ways. One is to right-click the tab for the Help topic and then choose Floating. You might also find it useful to open Help as a separate application. From the Start menu, choose Programs, Microsoft Visual Studio .Net, Microsoft Visual Studio .Net Documentation. (Make yourself a shortcut if you do this often.) That way, you can use ALT+TAB to switch between the IDE and Help.

Do you avoid Dynamic Help because you don’t like what it shows? No problem?you can customize it. From the Tools menu, choose Options. Expand the Environment folder and then click Dynamic Help. There you can select the number and types of topics that appear. If you need information on your choices there … click Help!

Found a topic in the docs that doesn’t answer your question? Tell the Visual Studio documentation team about it at [email protected].


Share the Post:
Heading photo, Metadata.

What is Metadata?

What is metadata? Well, It’s an odd concept to wrap your head around. Metadata is essentially the secondary layer of data that tracks details about the “regular” data. The regular

XDR solutions

The Benefits of Using XDR Solutions

Cybercriminals constantly adapt their strategies, developing newer, more powerful, and intelligent ways to attack your network. Since security professionals must innovate as well, more conventional endpoint detection solutions have evolved

AI is revolutionizing fraud detection

How AI is Revolutionizing Fraud Detection

Artificial intelligence – commonly known as AI – means a form of technology with multiple uses. As a result, it has become extremely valuable to a number of businesses across

AI innovation

Companies Leading AI Innovation in 2023

Artificial intelligence (AI) has been transforming industries and revolutionizing business operations. AI’s potential to enhance efficiency and productivity has become crucial to many businesses. As we move into 2023, several

data fivetran pricing

Fivetran Pricing Explained

One of the biggest trends of the 21st century is the massive surge in analytics. Analytics is the process of utilizing data to drive future decision-making. With so much of

kubernetes logging

Kubernetes Logging: What You Need to Know

Kubernetes from Google is one of the most popular open-source and free container management solutions made to make managing and deploying applications easier. It has a solid architecture that makes

ransomware cyber attack

Why Is Ransomware Such a Major Threat?

One of the most significant cyber threats faced by modern organizations is a ransomware attack. Ransomware attacks have grown in both sophistication and frequency over the past few years, forcing