public clsTCControl Add(System.Windows.Forms.Control ctl, DataView dataSource, string dataMember, System.Data.SqlDbType dataType, int dataSize, string Format = null, string Caption = null, System.Windows.Forms.Label Label = null) { clsTCControl tcc = new clsTCControl(); try { switch (Information.TypeName(ctl)) { case "ComboBox": throw new Exception("Use ComboBox-specific form of Add()"); default: var _with2 = tcc; _with2.Control = ctl; _with2.DataSource = dataSource; _with2.DataMember = dataMember; _with2.DataType = dataType; _with2.DataSize = dataSize; //Optional... _with2.Format = Format; _with2.Caption = Caption; _with2.LabelControl = Label; mControls.Add(tcc, ctl.Name); return(tcc); } } catch (Exception ex) { throw; } }
public clsTCControl Add(System.Windows.Forms.ComboBox ctl, DataView dataSource, string dataMember, System.Data.SqlDbType dataType, int dataSize, DataView displaySource, string displayMember, string Format = null, string Caption = null, System.Windows.Forms.Label Label = null) { clsTCControl tcc = new clsTCControl(); try { var _with1 = tcc; _with1.Control = ctl; _with1.DataSource = dataSource; _with1.DataMember = dataMember; _with1.DataType = dataType; _with1.DataSize = dataSize; _with1.DisplayMember = displayMember; _with1.DisplaySource = displaySource; //Optional... _with1.Format = Format; _with1.Caption = Caption; _with1.LabelControl = Label; mControls.Add(tcc, ctl.Name); return(tcc); } catch (Exception ex) { throw; } }