using System; using System.Text; using System.Windows.Forms; using System.Runtime.InteropServices; namespace DBForm { [InterfaceType(ComInterfaceType.InterfaceIsIDispatch)] public interface INavDefault { void InitializeComponent(); } [ClassInterface(ClassInterfaceType.None)] public partial class Form1 : Form, INavDefault { public Form1() { InitializeComponent(); this.Show(); } private void bOk_Click(object sender, EventArgs e) { tB2.Text = tB1.Text; } } }
public void InitializeComponent() { this.bOk = new System.Windows.Forms.Button(); this.tB1 = new System.Windows.Forms.TextBox(); this.tB2 = new System.Windows.Forms.TextBox(); ..... this.bOk.Click += new System.EventHandler(this.bOk_Click); ...... }
Comments
http://www.mibuso.com/forum/viewtopic.php?t=14394