namespace Example.csproj { public partial class SolidWorksMacro { public Form1 RWindow = new Form1(); public Form2 BWindow = new Form2(); public void Main() { BWindow.ShowDialog(); } public void PS() { MessageBox.Show("WORKING"); } public SldWorks swApp; } }
namespace Example.csproj { public partial class Form2 : Form { public Form2() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { Form1 frm = new Form1(); frm.Show(); this.Close(); } } }
namespace Example.csproj { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { //I tried to call method PS with this two below sentence, but I get error: No overload for method 'SolidWorksMacro' takes '0' arguments //SolidWorksMacro m_Macro = new SolidWorksMacro(); //m_Macro.PS(); this.Close(); } } }
SolidWorksMacro f = new SolidWorksMacro(); private void button1_Click(object sender, EventArgs e) { f.PS(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)