convert VB to C#

This commit is contained in:
2020-09-24 11:21:53 +02:00
parent 64277916cd
commit fecbeb4659
320 changed files with 17755 additions and 10320 deletions

View File

@@ -0,0 +1,26 @@
using global::System.Windows.Forms;
namespace Pilz.UI.Utils
{
public static class DrawingControl
{
private const int WM_SETREDRAW = 11;
public static void SuspendDrawing(this Control control)
{
User32Bridge.SendMessage(control.Handle, WM_SETREDRAW, false, 0);
}
public static void ResumeDrawing(this Control control)
{
control.ResumeDrawing(true);
}
public static void ResumeDrawing(this Control control, bool redraw)
{
User32Bridge.SendMessage(control.Handle, WM_SETREDRAW, true, 0);
if (redraw)
control.Refresh();
}
}
}

View File

@@ -1,28 +0,0 @@
Imports System.Runtime.CompilerServices
Imports System.Windows.Forms
Namespace Utils
Public Module DrawingControl
Private Const WM_SETREDRAW = 11
<Extension>
Public Sub SuspendDrawing(control As Control)
SendMessage(control.Handle, WM_SETREDRAW, False, 0)
End Sub
<Extension>
Public Sub ResumeDrawing(control As Control)
ResumeDrawing(control, True)
End Sub
<Extension>
Public Sub ResumeDrawing(control As Control, redraw As Boolean)
SendMessage(control.Handle, WM_SETREDRAW, True, 0)
If redraw Then control.Refresh()
End Sub
End Module
End Namespace

View File

@@ -0,0 +1,11 @@
using System;
using System.Runtime.InteropServices;
namespace Pilz.UI
{
public static class User32Bridge
{
[DllImport("user32.dll", CharSet = CharSet.Auto)]
internal static extern int SendMessage(IntPtr hWnd, int Msg, bool wParam, int lParam);
}
}

View File

@@ -1,5 +0,0 @@
Public Module User32Bridge
Friend Declare Auto Function SendMessage Lib "user32.dll" (hWnd As IntPtr, Msg As Integer, wParam As Boolean, lParam As Integer) As Integer
End Module