I've created a add-in in VS.NET 2005 using C#.
The add-in loads a tool window OnConnection and it contains a User
Control with input text fields and a "Login" button.
After the user clicks on this button, I want the User Control to
close and open another User Control after.
I was thinking I can have the Exec function in Connect.cs to listen
for events such as a button_click however I had no such luck. Would
this be the correct approach?
I've googled all over, but had no luck finding any advance articles
on handling ToolWindow events.
Any help is greatly appreciated.
Thanks
(The code below will explain a little more of what I'm trying to do.)
public void Exec(string commandName, vsCommandExecOption... )
{
handled=false;
if(executeOption ==
vsCommandExecOption.vsCommandExecOptionDoDefault)
{
if(commandName == "MyAddin.Connect.MyAddin")
{
handled = true;
return;
}
/* Clicking the "Login" button on the User Control form does
not execute this command. Why?*/
if(commandName == "MyAddin.LoginUserControl.btnLogin_Click)
{
/* Code to close LoginUserControl goes here*/
Debug.Print("=========Login button clicked!!=========");
/* Code to open another User Control goes here*/
....
}
}
...
..
/* End of code snippet */