Recently I am working on my own invoicing software. In order to change the TextBox to the TextBox (an underline) in my manager, I made a UserControl by referring to the two articles in CodeProject, userControl has the following functions:
-Space appearance switch:
ControlFormat: UnderLine, TextBox
-Whether it can be blank:
Nullable
-You can control the character length/byte length:
LengthType: LetterLength, ByteLength
MaxLength
-Validation Function
ValidationMode: None, ValidCharacters, InvalidCharacters, Letters, Numbers, RegularExpression
ValidationText
RegExPatternMode: Custom, Email, Url, IP, Dates, Zip
ErrorMessage
-Underline style
XBackColor: the background color of the control.
LineColor, underline color
LineWidth, underline width
-Similar to the data selection function of ComboBox
DataFrom: Select, HandInput
EnableDataSource: whether to enable the data source Mode
DataSource
KeyColumn, key value field, number
Wide column, abbreviation/Manual Number Field
ValueColumn, Value Field
SIndex, SelectedIndex
-Three-Value record (Key, Short, Value = Text)
Key
Short
Value
-Carriage return Mode
EnterMode: Enter, Tab, SwitchEnterAndTab, TabWhenTextNotNull
EnterStatus
-Carriage return Positioning
EnterLocate
LocateMode, positioning mode: Short, Value, locate Value, ValueShort
.
The following code and demo of the control are released for testing.
Download: UnderLineText-src
Note: This source code is for your reference only. I am not responsible for any problems arising during use and all problems that arise.