Tip Bank

DevX - Software Development Resource

Copy Filenames to a Clipboard

File hierarchies are becoming more complex and file paths longer as the capacity of hard drives increases. There are still many occasions, however, when you can’t browse to identify a

DevX - Software Development Resource

Take a Quick Look at a File

The Windows Script Host (WSH) supports many useful features, including VBScript’s FileSystemObject object and the ability to drag and drop filenames. You can drag and drop a data files icon

DevX - Software Development Resource

InvokeMethod – Invoking a method via reflection

‘ Invoke a method via reflection and return its result – return null if method ‘ doesn’t exist or throws’ Note: requires Imports System.Reflection” Example:’ Function GetCompleteName(ByVal firstName As String,’

DevX - Software Development Resource

GetProperty – Reading a property via reflection

‘ Read a property via reflection or return a default value’ Example: MessageBox.Show(GetProperty(Button1, “Text”, “”))Function GetProperty(ByVal obj As Object, ByVal propertyName As String, _ ByVal defaultValue As Object) As Object

DevX - Software Development Resource

SetProperty – Setting a property via reflection

‘ Set a property via reflection and return True if successful’ Example: SetProperty(Button1, “Text”, “Click me”)Function SetProperty(ByVal obj As Object, ByVal propertyName As String, _ ByVal val As Object) As

DevX - Software Development Resource

IsMemberSupported – Check whether an object supports a member with the specified name

‘ Check whether an object supports a member with the specified name” Examples:’ Debug.WriteLine(IsMemberSupported(Button1, “BackColor”)) ‘ => True’ Debug.WriteLine(IsMemberSupported(Button1, “Focus”)) ‘ => True’ Debug.WriteLine(IsMemberSupported(Button1, “TextColor”)) ‘ => False’ Debug.WriteLine(IsMemberSupported(Button1, “Print”))