Created
March 23, 2021 05:26
-
-
Save Benshi/086f6482e754e2955b9d5448d9f7c975 to your computer and use it in GitHub Desktop.
TextChanged イベントを発生させずに TextBox の Text を書き換える
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Public Module TextBoxBaseExtensions | |
<System.Runtime.CompilerServices.Extension> | |
Public Sub SetText(this As TextBoxBase, value As String) | |
Static forceWindowText As System.Reflection.MethodInfo = GetType(System.Windows.Forms.TextBoxBase).GetMethod("ForceWindowText", System.Reflection.BindingFlags.NonPublic Or System.Reflection.BindingFlags.Instance) | |
forceWindowText.Invoke(this, New Object(0) {value}) | |
End Sub | |
End Module |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment