我尝试向自定义控件微调器添加其他功能,但在尝试添加其他命令时出现错误。任何有此经验的人都可以解释为什么这会继续出错。您只需搜索“MouseUp”即可找到有问题的行。它靠近XAML的下三分之一。当我尝试添加它时,它会崩溃。
错误:
抛出异常:' System.Windows.Markup.XamlParseException'在 PresentationFramework.dll
Numeric.xaml
MakeTopMostWindow(Me.Handle.ToInt64, True)
Application.DoEvents()
MakeTopMostWindow(Me.Handle.ToInt64, False)
被调用的命令是:
Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Integer, ByVal hWndInsertAfter As Integer, ByVal x As Integer, ByVal y As Integer, ByVal cx As Integer, ByVal cy As Integer, ByVal wFlags As Integer) As Integer
Friend Sub MakeTopMostWindow(ByVal hwnd As Int64, ByVal MakeTopMostFlag As Boolean)
Dim HWND_TOPMOST As Integer
If MakeTopMostFlag Then
HWND_TOPMOST = -1
Else
HWND_TOPMOST = -2
End If
Dim SWP_NOMOVE As Integer = &H2
Dim SWP_NOSIZE As Integer = &H1
Dim TOPMOST_FLAGS As Integer = SWP_NOMOVE Or SWP_NOSIZE
Try
SetWindowPos(hwnd, HWND_TOPMOST, 0, 0, 0, 0, TOPMOST_FLAGS)
Catch ex As Exception
End Try
End Sub