Browse Source

новая ветка под новый ПИВ 1.23

20230823
Денис Кузнецов 3 years ago
parent
commit
cfd0fd806d
  1. 7
      AboutBox1.cs
  2. 2
      AboutBox1.resx
  3. 16
      ifdebug.snippet
  4. 19
      ivk.snippet
  5. 16
      util.cs

7
AboutBox1.cs

@ -7,6 +7,7 @@ using System.Reflection; @@ -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 @@ -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;
}

2
AboutBox1.resx

@ -342,7 +342,7 @@ @@ -342,7 +342,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAB2
2QIAAk1TRnQBSQFMAgEBAgEAATgBAQE4AQEBtAEAAbQBAAT/ARkBAAj/AUIBTQE2BwABNgMAASgDAAHQ
2QIAAk1TRnQBSQFMAgEBAgEAAVABAQFQAQEBtAEAAbQBAAT/ARkBAAj/AUIBTQE2BwABNgMAASgDAAHQ
AQICAAG0AwABAQEAARgFAAHAAe4BBREA//8D/wHMAdUCzAGqAswB1QKZAaoCzAGqApkBqgHMAZkBqgGZ
AcwBqgKZAaoCzAHVApkBqgLMAaoBmQHMAaoCzAHVAcwBmQGqAcwBmQGqAswBqgKZAaoCzAHVAswBqgHM
AZkBqgGZAcwBqgLMAaoCmQGqAswBqgGZAcwB1QLMAdUBzAX/AswB1QLMAaoCzAHVAswBqgLMAdUCzAGq

16
ifdebug.snippet

@ -0,0 +1,16 @@ @@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>ifDEBUG</Title>
<Shortcut>ifdebug</Shortcut>
</Header>
<Author>DK</Author>
<Description>insert #if DEBUG</Description>
<Snippet>
<Code Language="CSharp">
<![CDATA[#if DEBUG #endif]]>
</Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>

19
ivk.snippet

@ -0,0 +1,19 @@ @@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>ivk</Title>
<Shortcut>ivk</Shortcut>
</Header>
<Author>DK</Author>
<Description>insert Invoke((MethodInvoker)</Description>
<Snippet>
<Code Language="CSharp">
<![CDATA[ this.Invoke((MethodInvoker)(delegate
{
}));
]]>
</Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>

16
util.cs

@ -576,6 +576,22 @@ namespace UTIL @@ -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<T>
{

Loading…
Cancel
Save