System.Windows.Controls.TextBox Handle

后端 未结 1 1762
南旧
南旧 2020-12-22 01:01

I feel like I\'m missing something really obvious here.

I know that forms in general have a Handle property, but I am using a System.Windows.Cont

相关标签:
1条回答
  • 2020-12-22 01:39

    You can just call Handle on the TextBox. It is an inherited property from System.Windows.Forms.Control.

    Edit: Question was updated to ask about WPF

    WPF doesn't use handles like a typical Win32 application or WinForms application. Each control is not its own Window in WPF. You can verify this with Spy++, it cannot differentiate between each control. Therefore you cannot SendMessage to the individual controls like you can with WinForms and Win32 apps.

    You can use WindowInteropHelper to get the parent window handle of a WPF window.

    0 讨论(0)
提交回复
热议问题