본문 바로가기

Category

(302)
[C#] Detect UserControl's Closing using System.Windows.Forms; namespace DetectUserControlClosing { public partial class UserControl1 : UserControl { public UserControl1() { InitializeComponent(); } protected override void OnCreateControl() { base.OnCreateControl(); this.ParentForm.FormClosing += new FormClosingEventHandler(ParentForm_FormClosing); } private void ParentForm_FormClosing(object sender, FormClosingEventArgs e) { Dia..
[C#] DockPanel Suite Sample using WeifenLuo.WinFormsUI.Docking; namespace DockPanelSample { public partial class FormChild : DockContent { public FormChild() { InitializeComponent(); } } } using System; using System.Windows.Forms; namespace DockPanelSample { public partial class FormMain : Form { private FormChild formChild1; private FormChild formChild2; private FormChild formChild3; private FormChild formChild4; public F..
[C#] DockPanel Suite Sample using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using WeifenLuo.WinFormsUI.Docking; namespace DockPanelSample { public partial class FormChild : DockContent { public FormChild() { InitializeComponent(); } } } using System; using System.Collections.Generic; using System.ComponentMo..
[C#] MDI Sample using System; using System.Windows.Forms; namespace MdiSample { public partial class FormMain : Form { public FormMain() { InitializeComponent(); } private void menuItemNew_Click(object sender, EventArgs e) { FormChild newMDIChild = new FormChild(); newMDIChild.MdiParent = this; // Set the Parent Form newMDIChild.Show(); // Display the new form } private void menuItemCascade_Click(object sender,..
[C#] SqlCeDataAdapter, SqlCeCommandBuilder using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.Data.SqlServerCe; namespace DataSample { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void toolStripButtonReadXml_Click(object sender, EventArgs e) { this.dataSet1.Clear(); this.d..
[C#] DataSet, Primary Key, Foreign Key Constraint using System; using System.Data; using System.Windows.Forms; namespace ConstraintSample { public partial class Form1 : Form { public Form1() { InitializeComponent(); InitializeMyComponent(); } private void InitializeMyComponent() { // Shop DataSet DataSet shopDataSet = new DataSet("Shop"); // Person DataTable DataTable personDataTable = new DataTable("Person"); shopDataSet.Tables.Add(personDataT..
[C#] DataSet, BindingSource, BindingNavigator, DataGridView.DataError, BindingSource.AddNew using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; namespace DataSetSample { public partial class Form1 : Form { private DataSet ourDataSet; private DataTable ourDataTable; private BindingSource ourBindingSource; public Form1() { InitializeComponent(); InitializeMyComponent(); } priv..
[C#] SQL Compact & DataGridView Binding Sample using System; using System.Data; using System.Windows.Forms; namespace NaverSample { public partial class Form1 : Form { private NaverDataSet ourNaverDataSet; private NaverDataSetTableAdapters.AccountTableAdapter ourAccountTableAdapter; private NaverDataSetTableAdapters.TableAdapterManager ourTableAdapterManager; private BindingSource ourBindingSource; public Form1() { InitializeComponent(); Ini..