neue version

This commit is contained in:
ja
2021-09-07 10:55:23 +02:00
parent 2c80644224
commit 99b069d611
335 changed files with 236971 additions and 59 deletions

View File

@@ -0,0 +1,40 @@
Imports System.ComponentModel
Imports System.Drawing
Imports System.Windows.Forms
Public Class MyRichTextBox
Inherits System.Windows.Forms.RichTextBox
Property MaxLines_Warning As String = ""
Property MaxLines_Warning_Label As Label = Nothing
Property MaxLineLength As Integer = -1
Private Sub MyTextBox_Leave(sender As Object, e As EventArgs) Handles Me.Leave
If MaxLineLength > 0 Then
Dim str() As String = Me.Lines
For i = 0 To Me.Lines.Count - 1
If str(i).Length > MaxLineLength Then
str(i) = str(i).Substring(0, MaxLineLength)
End If
Next
Me.Lines = str
End If
End Sub
Private Sub MyTextBox_Textchanged(sender As Object, e As EventArgs) Handles Me.TextChanged
'sender.ForeColor = System.Drawing.Color.Black
If Me.Multiline And IsNumeric(MaxLines_Warning) Then
' If Me.Lines.Length > MaxLines Then
If MaxLines_Warning_Label IsNot Nothing Then
MaxLines_Warning_Label.Visible = CBool(Me.Lines.Length > MaxLines_Warning)
End If
'End If
End If
End Sub
End Class