我正在尝试为DateTimePicker获取SelectionStart和SelectionLength属性,但没有成功。 由于这些属性不存在,我尝试通过子类化在DTP中获取TextBoxBase。也没有任何可用的结果。像这样:
Protected Overrides Sub OnKeyDown(e As KeyEventArgs)
Dim txtBase As TextBoxBase = TryCast(Me.Controls(0), TextBoxBase)
_selectionStart = txtBase.SelectionStart
_selectionLength = txtBase.SelectionLength
...
知道如何在VB.NET或C#中使用DTP的TextBoxBase或SelectionStart和SelectionLength吗?