I made a few changes (included the "Command line arguements"). Now the code is:
In frmMain (The main/ Startup form):
When FrmMain is Loaded:Code:Public Sub CheckAssociation() My.Computer.Registry.ClassesRoot.CreateSubKey(".tbx").SetValue("", "Tiny Toolbox", Microsoft.Win32.RegistryValueKind.String) My.Computer.Registry.ClassesRoot.CreateSubKey("Tiny Toolbox\shell\open\command").SetValue("", Application.ExecutablePath & " ""%1"" ", Microsoft.Win32.RegistryValueKind.String) My.Computer.Registry.ClassesRoot.CreateSubKey("Tiny Toolbox\DefaultIcon").SetValue("", Application.StartupPath & "\TBX.ico") End Sub
Code:CheckAssociation() If My.Application.CommandLineArgs.Count > 0 Then frmResultsViewer.Show() End If
I get this error just before frmResultsViewer is Loaded.
Unhandled exception.
File Format is not valid.
Code:************** Exception Text ************** System.ArgumentException: File format is not valid. at System.Windows.Forms.RichTextBox.StreamIn(Stream data, Int32 flags) at System.Windows.Forms.RichTextBox.LoadFile(Stream data, RichTextBoxStreamType fileType) at System.Windows.Forms.RichTextBox.LoadFile(String path, RichTextBoxStreamType fileType) at DevComponents.DotNetBar.Controls.RichTextBoxEx.LoadFile(String path) at Tiny_Toolbox.frmResultsViewer.frmResultsViewer_Load(Object sender, EventArgs e) in C:\Users\AMK\Documents\Visual Studio 2010\Projects\Tiny Toolbox\Tiny Toolbox\frmResultsViewer.vb:line 33 at System.Windows.Forms.Form.OnLoad(EventArgs e) at DevComponents.DotNetBar.RibbonForm.OnLoad(EventArgs e) at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible) at System.Windows.Forms.Control.CreateControl() at System.Windows.Forms.Control.WmShowWindow(Message& m) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.Form.WmShowWindow(Message& m) at System.Windows.Forms.Form.WndProc(Message& m) at DevComponents.DotNetBar.RibbonForm.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)




Reply With Quote