diff --git a/AboutBox1.cs b/AboutBox1.cs index 87e3cee..6179df4 100644 --- a/AboutBox1.cs +++ b/AboutBox1.cs @@ -7,6 +7,7 @@ using System.Reflection; using System.Threading.Tasks; using System.Windows.Forms; using UTIL; +using static System.Windows.Forms.VisualStyles.VisualStyleElement; namespace AB { @@ -151,10 +152,10 @@ namespace AB */ private void AboutBox1_Load(object sender, EventArgs e) { + Util.SetTabWidth(textBoxDescription, 1); + } - } - - private void logoPictureBox_MouseEnter(object sender, EventArgs e) + private void logoPictureBox_MouseEnter(object sender, EventArgs e) { timer1.Enabled = true; } diff --git a/AboutBox1.resx b/AboutBox1.resx index f7afe6f..dfc1b68 100644 --- a/AboutBox1.resx +++ b/AboutBox1.resx @@ -342,7 +342,7 @@ AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAB2 - 2QIAAk1TRnQBSQFMAgEBAgEAATgBAQE4AQEBtAEAAbQBAAT/ARkBAAj/AUIBTQE2BwABNgMAASgDAAHQ + 2QIAAk1TRnQBSQFMAgEBAgEAAVABAQFQAQEBtAEAAbQBAAT/ARkBAAj/AUIBTQE2BwABNgMAASgDAAHQ AQICAAG0AwABAQEAARgFAAHAAe4BBREA//8D/wHMAdUCzAGqAswB1QKZAaoCzAGqApkBqgHMAZkBqgGZ AcwBqgKZAaoCzAHVApkBqgLMAaoBmQHMAaoCzAHVAcwBmQGqAcwBmQGqAswBqgKZAaoCzAHVAswBqgHM AZkBqgGZAcwBqgLMAaoCmQGqAswBqgGZAcwB1QLMAdUBzAX/AswB1QLMAaoCzAHVAswBqgLMAdUCzAGq diff --git a/ifdebug.snippet b/ifdebug.snippet new file mode 100644 index 0000000..499532a --- /dev/null +++ b/ifdebug.snippet @@ -0,0 +1,16 @@ + + + +
+ ifDEBUG + ifdebug +
+ DK + insert #if DEBUG + + + + + +
+
\ No newline at end of file diff --git a/ivk.snippet b/ivk.snippet new file mode 100644 index 0000000..008cb71 --- /dev/null +++ b/ivk.snippet @@ -0,0 +1,19 @@ + + + +
+ ivk + ivk +
+ DK + insert Invoke((MethodInvoker) + + + + + +
+
\ No newline at end of file diff --git a/util.cs b/util.cs index 444df95..7b18449 100644 --- a/util.cs +++ b/util.cs @@ -576,6 +576,22 @@ namespace UTIL else return DateTime.Now.ToString("HH:mm:ss"); } + private const int EM_SETTABSTOPS = 0x00CB; + + [DllImport("User32.dll", CharSet = CharSet.Auto)] + public static extern IntPtr SendMessage(IntPtr h, int msg, int wParam, int[] lParam); + + public static void SetTabWidth(TextBox textbox, int tabWidth) + { + Graphics graphics = textbox.CreateGraphics(); + var characterWidth = (int)graphics.MeasureString("M", textbox.Font).Width; + SendMessage + (textbox.Handle + , EM_SETTABSTOPS + , 1 + , new int[] { tabWidth * characterWidth } + ); + } } public class CircularBuffer {