I have a file browser in my project and when I click the file I would like it to open up in Visual Studio - I can do this at the moment. Then when I click another file, I would like Visual Studio to switch the focused file to the new file.
So far I have managed to open Visual Studio at the correct project and file with the following code.
Process p = new Process();
p.StartInfo.FileName = @"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\devenv.exe";
p.StartInfo.Arguments = projectPath+" "+ filePath;
p.Start();
I would like to be able to switch the file in Visual Studio based upon what I have clicked on in my project.