Im working on a OutLookAddIn Project and for a particualr scenario i added a winform to the outllookaddin project, so when the user first loads the project the winform opens up...After entering his UserId and Password and clicking the submit button i want to call a method that is in the class 'ThisAddIn' but im not able to access the method from windows form class, im getting the error as ''OutlookAddIn1.ThisAddIn' does not contain a constructor that takes 0 arguments''....how can i get rid of this...just posting some sample code below
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;
using Outlook = Microsoft.Office.Interop.Outlook;
using Office = Microsoft.Office.Core;
using System.Windows.Forms;
namespace OutlookAddIn1
{
public partial class ThisAddIn
{
private void ThisAddIn_Startup(object sender, System.EventArgs e)
{
}
private void ThisAddIn_Shutdown(object sender, System.EventArgs e)
{
}
public void Validate()
{
MessageBox.Show("Success");
}
#region VSTO generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InternalStartup()
{
this.Startup += new System.EventHandler(ThisAddIn_Startup);
this.Shutdown += new System.EventHandler(ThisAddIn_Shutdown);
}
#endregion
}
}
My Winform class from where i want to access the method 'Validate'
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace OutlookAddIn1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
}
}
}
In the button1_Click event i want t0 access the method validate, so need some advice from experts here..