Click here to Skip to main content
15,886,110 members
Articles / Programming Languages / Visual Basic

Status List - Vista Style

Rate me:
Please Sign up or sign in to vote.
4.52/5 (12 votes)
31 Mar 2007CPOL1 min read 59.6K   2.3K   90  
A progress list for displaying the status of various tasks
Imports System.ComponentModel.Design.Serialization
Imports System.ComponentModel

Public Class StatusItemConverter
	 Inherits TypeConverter

#Region " Methods "

	 ' Get a boolean type determining whether or not the control can be converted to a status item
	 Public Overloads Overrides Function CanConvertTo(ByVal context As ITypeDescriptorContext, ByVal destType As Type) As Boolean
		  If destType Is GetType(InstanceDescriptor) Then
				Return True
		  End If

		  Return MyBase.CanConvertTo(context, destType)
	 End Function

	 ' Convert the specified control to a status item
	 Public Overloads Overrides Function ConvertTo(ByVal context As ITypeDescriptorContext, ByVal culture As System.Globalization.CultureInfo, ByVal value As Object, ByVal destType As Type) As Object
		  If destType Is GetType(InstanceDescriptor) Then
				Dim ci As System.Reflection.ConstructorInfo = GetType(StatusItem).GetConstructor(System.Type.EmptyTypes)

				Return New InstanceDescriptor(ci, Nothing, False)
		  End If

		  Return MyBase.ConvertTo(context, culture, value, destType)
	 End Function

#End Region

End Class

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer uSoftware
Australia Australia
Shaps currently works as the Senior Networks Administrator for a small IT company in Australia. He is also involved in various software developments, for Windows, Windows Mobile, iPhone, Mac and occasionally the web. His central focus in this area, is User Interface design.

If he had spare time, he'd play some tunes, read a book or visit the gym. Until then, he writes small applications for the iPhone that help improve his productivity at work.

Comments and Discussions