NET DateTimePicker SelectionStart和SelectionLength属性

时间:2017-02-12 15:27:18

标签: .net vb.net

我正在尝试为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吗?

0 个答案:

没有答案
相关问题