May 26, 2003

GotoPreviousWindow – A macro to jump to the previously selected window

‘ This macro routine makes VS.NET switch to the previously selected code editor ‘ / designer window, if it is still open. It is equal to opening the Windows ‘ menu and selecting the 2nd window.’ Note: put this routine in the MyMacro project, by using the Macro Explorer. ‘

CreateIISVirtualDirectory – Creating an IIS virtual directory

‘ Creates a IIS virtual directory with the specified name,’ and that points to the specified physical path’ Note: requires a reference to the System.DirectoryServices.dll assembly’ Note: exception handling (for example to catch an invalid path) should be ‘ added in the calling code.” Example:’ Try’ CreateIISVirtualDirectory(“MyTestDir”, “d: emp empdir”)’

ResetControls – Reset the value for the input array of controls

‘ Resets the value for the input array of controls, and thier child controls’ Example:’ – reset all the controls on the form: ResetControls(Me)’ – reset specific controls: ResetControls(TextBox1, CheckBox1, GroupBox1)Sub ResetControls(ByVal ParamArray ctls() As Control) ‘ clear input control Dim ctl As Control For Each ctl In ctls If

RemoveIISVirtualDirectory – Removing an IIS virtual directory

‘ Removes the IIS virtual directory with the specified name’ Note: requires a reference to the System.DirectoryServices.dll assembly’ Note: exception handling (for example to catch an invalid virtual directory ‘ name or path) should be added in the calling code.” Example:’ Try’ RemoveIISVirtualDirectory(“MyTestDir”)’ Catch ex As Exception’ MessageBox.Show(ex.Message)’ End TrySub

GetControlsByType – Retrieving an array of controls of the specified type

‘ Returns an array of controls of the specified type,’ found within the specified parent control (or the form itself).’ Note: the search is optionally done recursively, by checking also controls’ ‘ child controls’ Example: get an array with the form’s textboxes’ Dim textboxes() As TextBox = GetControlsByType(Me, GetType(TextBox))Function GetControlsByType(ByVal