diff --git a/ServerExplorer/Controls/CustomTextBox.cs b/ServerExplorer/Controls/CustomTextBox.cs new file mode 100644 index 0000000..27d70de --- /dev/null +++ b/ServerExplorer/Controls/CustomTextBox.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Windows.Forms; +using System.Runtime.InteropServices; + +namespace ServerExplorer.Controls +{ + [ComVisible(true)] + [ClassInterface(ClassInterfaceType.AutoDispatch)] + public class CustomTextBox : TextBox + { + #region SetTabWidth + + private const int EM_SETTABSTOPS = 0x00CB; + + [DllImport("User32.dll", CharSet = CharSet.Auto)] + private static extern IntPtr SendMessage(IntPtr h, int msg, int wParam, int[] lParam); + + public void SetTabWidth(int tabWidth) + { + SendMessage(this.Handle, EM_SETTABSTOPS, 1, new int[] { tabWidth * 4 }); + } + + #endregion + + private int _tabWidth=8; + public int TabWidth + { + get { return _tabWidth; } + set + { + _tabWidth = value; + SetTabWidth(value); + } + } + } +} diff --git a/ServerExplorer/ServerExplorer.csproj b/ServerExplorer/ServerExplorer.csproj index 9ce5b05..bab6f86 100644 --- a/ServerExplorer/ServerExplorer.csproj +++ b/ServerExplorer/ServerExplorer.csproj @@ -75,6 +75,9 @@ + + Component + Form diff --git a/ServerExplorer/UI/FrmBaseDatos.Designer.cs b/ServerExplorer/UI/FrmBaseDatos.Designer.cs index 7417fd4..df10d66 100644 --- a/ServerExplorer/UI/FrmBaseDatos.Designer.cs +++ b/ServerExplorer/UI/FrmBaseDatos.Designer.cs @@ -28,7 +28,7 @@ /// private void InitializeComponent() { - this.txtConString = new System.Windows.Forms.TextBox(); + this.txtConString = new ServerExplorer.Controls.CustomTextBox(); this.lblConString = new System.Windows.Forms.Label(); this.btnCopiarConString = new System.Windows.Forms.Button(); this.menuBaseDatos = new System.Windows.Forms.MenuStrip(); @@ -350,7 +350,7 @@ #endregion - private System.Windows.Forms.TextBox txtConString; + private ServerExplorer.Controls.CustomTextBox txtConString; private System.Windows.Forms.Label lblConString; private System.Windows.Forms.Button btnCopiarConString; private ServerExplorer.Controls.CustomListView lsvTablas; diff --git a/ServerExplorer/UI/FrmExec.Designer.cs b/ServerExplorer/UI/FrmExec.Designer.cs index 017d564..47221ca 100644 --- a/ServerExplorer/UI/FrmExec.Designer.cs +++ b/ServerExplorer/UI/FrmExec.Designer.cs @@ -29,7 +29,7 @@ private void InitializeComponent() { this.btnExec = new System.Windows.Forms.Button(); - this.txtCommand = new System.Windows.Forms.TextBox(); + this.txtCommand = new ServerExplorer.Controls.CustomTextBox(); this.dgvDatos = new System.Windows.Forms.DataGridView(); this.splitContainer1 = new System.Windows.Forms.SplitContainer(); this.btnGenInserts = new System.Windows.Forms.Button(); @@ -129,7 +129,7 @@ #endregion private System.Windows.Forms.Button btnExec; - private System.Windows.Forms.TextBox txtCommand; + private ServerExplorer.Controls.CustomTextBox txtCommand; private System.Windows.Forms.DataGridView dgvDatos; private System.Windows.Forms.SplitContainer splitContainer1; private System.Windows.Forms.Button btnGenInserts; diff --git a/ServerExplorer/UI/FrmProcedimientos.Designer.cs b/ServerExplorer/UI/FrmProcedimientos.Designer.cs index fdb345c..adb0ca0 100644 --- a/ServerExplorer/UI/FrmProcedimientos.Designer.cs +++ b/ServerExplorer/UI/FrmProcedimientos.Designer.cs @@ -33,7 +33,7 @@ this.colSchema = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.colFecha = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.colTipo = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.txtProc = new System.Windows.Forms.TextBox(); + this.txtProc = new ServerExplorer.Controls.CustomTextBox(); this.splitContainer1 = new System.Windows.Forms.SplitContainer(); this.splitContainer1.Panel1.SuspendLayout(); this.splitContainer1.Panel2.SuspendLayout(); @@ -94,6 +94,7 @@ this.txtProc.ScrollBars = System.Windows.Forms.ScrollBars.Both; this.txtProc.Size = new System.Drawing.Size(352, 475); this.txtProc.TabIndex = 1; + this.txtProc.TabWidth = 4; // // splitContainer1 // @@ -137,7 +138,7 @@ private ServerExplorer.Controls.CustomListView lsvProcs; private System.Windows.Forms.ColumnHeader colNombre; private System.Windows.Forms.ColumnHeader colFecha; - private System.Windows.Forms.TextBox txtProc; + private ServerExplorer.Controls.CustomTextBox txtProc; private System.Windows.Forms.SplitContainer splitContainer1; private System.Windows.Forms.ColumnHeader colTipo; private System.Windows.Forms.ColumnHeader colSchema; diff --git a/ServerExplorer/UI/FrmServidores.Designer.cs b/ServerExplorer/UI/FrmServidores.Designer.cs index bdd221f..f009ed8 100644 --- a/ServerExplorer/UI/FrmServidores.Designer.cs +++ b/ServerExplorer/UI/FrmServidores.Designer.cs @@ -34,11 +34,11 @@ this.colVersion = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.btnListarServidores = new System.Windows.Forms.Button(); this.lblServidor = new System.Windows.Forms.Label(); - this.txtServidor = new System.Windows.Forms.TextBox(); + this.txtServidor = new ServerExplorer.Controls.CustomTextBox(); this.lblUsuario = new System.Windows.Forms.Label(); this.lblContrasenha = new System.Windows.Forms.Label(); - this.txtUsuario = new System.Windows.Forms.TextBox(); - this.TxtContrasenha = new System.Windows.Forms.TextBox(); + this.txtUsuario = new ServerExplorer.Controls.CustomTextBox(); + this.TxtContrasenha = new ServerExplorer.Controls.CustomTextBox(); this.btnListarBBDD = new System.Windows.Forms.Button(); this.lsvBBDD = new ServerExplorer.Controls.CustomListView(); this.colDBName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); @@ -242,11 +242,11 @@ private System.Windows.Forms.ColumnHeader colInstancia; private System.Windows.Forms.ColumnHeader colVersion; private System.Windows.Forms.Label lblServidor; - private System.Windows.Forms.TextBox txtServidor; + private ServerExplorer.Controls.CustomTextBox txtServidor; private System.Windows.Forms.Label lblUsuario; private System.Windows.Forms.Label lblContrasenha; - private System.Windows.Forms.TextBox txtUsuario; - private System.Windows.Forms.TextBox TxtContrasenha; + private ServerExplorer.Controls.CustomTextBox txtUsuario; + private ServerExplorer.Controls.CustomTextBox TxtContrasenha; private System.Windows.Forms.Button btnListarBBDD; private ServerExplorer.Controls.CustomListView lsvBBDD; private System.Windows.Forms.ColumnHeader colDBName;