Export (0) Print
Expand All

Code for Component Programming

Visual Studio .NET 2003

This topic is designed to help you find code that demonstrates how to perform common component programming tasks in Visual Basic .NET. The following categories are represented in the list below:

You can also find sample code for component programming in the following locations:

Component Authoring

Example of...

Creating a simple component

Declaring a method in a component

Declaring an overloaded method in a component

Declaring and raising events in components

Creating named constants for components

Implementing properties in components

Implementing default properties in components

Exposing properties of contained objects

Saving and retrieving the state of a component

Creating abstract classes

Creating interfaces

Implementing existing interfaces

Displaying forms from components

Allowing for communication between components in an assembly

Containers and Sites

Example of...

Creating component containers

Extending component containers

Implementing nested classes

Linking dependent objects

Implementing collection properties

Multithreading

Example of...

Creating a simple multithreaded component

Creating a new thread of execution

Creating a lock on a thread

Writing to event logs from multithreaded components

Manipulating controls from threads

Exception Handling

Example of...

Throwing exceptions from components

Handling exceptions in components

Component Security

Example of...

Adding security attributes to your components

Adding imperative security checks to your components

User Assistance

Example of...

Displaying a help file for your component

Providing descriptive metadata for your component

Providing descriptive metadata for component properties, methods, and events

User and Custom Controls

Example of...

Creating a user control for Windows Forms applications

Inheriting from a Windows Forms control

Exposing Properties of Constituent Controls

Implementing Methods in Custom Controls

Painting and Rendering Custom Controls

Painting and Rendering Constituent Controls

Making Controls Invisible at Run Time

Docking and aligning controls

Adding your controls to the toolbox

Adding tooltips to your controls

Giving your control a transparent background

Messaging Components

Example of...

Creating a simple message queuing application

Creating public and private queues

Purging a queue's contents

Instantiating components to interact with a message queue

Sending simple messages

Sending complex messages

Sending messages to a journal queue

Specifying the format for received messages

Taking messages out of a queue

Peeking at queue contents

Receiving messages asynchronously

Sending transactional messages

Retrieving lists of available messages

Retrieving lists of available queues

File System and Timer Components

Example of...

Creating a simple application that monitors the file system

Instantiating components to monitor files or directories

Specifying what to monitor for

Handling file system events

Pausing a thread for continuation when a file system event occurs

Creating and configuring server-based timers

Monitoring server-based timers

Performance Counter Components

Example of...

Creating a simple application that retrieves existing categories and counters

Creating a simple application that writes to a counter

Instantiating components to interact with performance counters

Specifying the counter to monitor

Creating custom counters

Creating counter categories

Determining if a counter or category already exists

Adding and removing counter instances

Writing values to performance counters

Retrieving raw values from a performance counter

Retrieving calculated values from a performance counter

Sampling performance counter values

Retrieving lists of categories and counters

Event Log Components

Example of...

Determining if an event log exists

Creating custom event logs

Deleting event logs

Clearing event log entries

Instantiating a component to interact with an event log

Adding your application as a source of events

Writing entries to event logs

Reading entries from event logs

Handling event log events

Services and Processes

Example of...

Instantiating components to interact with services

Stopping, starting, and pausing services

Retrieving lists of services

Connecting to processes on another computer

Binding to existing processes

Starting processes

Stopping processes

Determining if a process is responding

Determining if a process has exited

Viewing running processes

Waiting for a process to complete an action

Investigating memory usage for a process

Investigating thread usage for a process

Creating a simple application that monitors a process

Active Directory Components

Example of...

Instantiating a component to interact with an Active Directory heirarchy

Creating nodes in a heirarchy

Removing heirarchy nodes

Searching a heirarchy

Creating a simple application that creates Active Directory objects

Related Code Examples

Code for Windows Forms Controls

Code Examples for Visual Basic Programmers

Show:
© 2014 Microsoft