Dim ItemKeyStr As String = e.Tool.Key If Not String.IsNullOrEmpty(ItemKeyStr) Then If ItemKeyStr.StartsWith("frm", StringComparison.CurrentCultureIgnoreCase) Then '-- If this is a form its name should start with "frm", so lets get the main form's AssemblyQualifiedName ' and remove the [, Version=] string and replace its name with the ItemKeyStr value which should be the ' form's name to be open. Dim mOpenFullName As String = String.Empty Dim AssemblyQualifiedName As String = Me.GetType().AssemblyQualifiedName mOpenFullName = AssemblyQualifiedName.Remove(AssemblyQualifiedName.IndexOf(", Version=")).Replace(Me.Name, ItemKeyStr) Me.LaunchDialog(Type.GetType(mOpenFullName)) ' Me.LaunchDialog(Type.GetType(ItemKeyStr)) Else '-- Process all custom forms and options here. Select Case e.Tool.Key Case "DatabaseConnection" ' ButtonTool '-- Set the connections Me.SetDatabaseConnection() '-- TODO: close all child forms to force them to use the new connection string Case "SecurityMaintenanceForm" ' ButtonTool Me.ShowSecurityDialog() Case "Exit" ' ButtonTool Me.Close() End Select End If End If