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
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
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
‘ 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,’
‘ Return the value of the public field with the specified name,’ defined inside the obj object’ Note: requires Imports System.Reflection” Example:’ Public TestField As String = “hello”‘ …’ MessageBox.Show(GetField(Me,
‘ 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
‘ 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
‘ 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”))
‘ Check whether a given regular expression is in valid format’ Examples:’ Debug.WriteLine(IsValidRegularExpression(“^(((d{3}) ‘ ?)|(d{3}-))?d{3}-d{4}$”)) ‘ => True’ Debug.WriteLine(IsValidRegularExpression(“^[|)$”)) ‘ => FalseFunction IsValidRegularExpression(ByVal regex As String) As Boolean Try Dim
‘ Returns an array with all the controls in the specified container control and ‘ its child containers’ Example:’ ‘ print the name of all the controls on the form