Windowsアプリケーションをwpfアプリケーションに変換しようとしていますが、すべて問題ありませんが、この時点で、wpfのコードで次の宣言が機能しないように変換することになりました。
これらはWindows宣言です。
Dim screenwidth As String = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width
Dim screenheight As String = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height
私はこれらの宣言と同等のクラスプロパティを見つけるためにグーグルで検索しました、そして私はいくつかのものを手に入れました、しかしそれらは存在していますが、私がそれらを使おうとしている時点では機能していません
" PointToScreen(New Point(0,0)) "は次のとおりです。
コードでこれらを使用する場合:
Dim screenwidth As String = System.Windows.SystemParameters.VirtualScreenWidth Dim screenheight As String = System.Windows.SystemParameters.VirtualScreenHeight'(OR)
Dim screenwidth As String = System.Windows.SystemParameters.PrimaryScreenWidth Dim screenheight As String = System.Windows.SystemParameters.PrimaryScreenHeight
With MyPanel
.PointToScreen(New Point(SystemParameters.VirtualScreenWidth, 0)) ' Getting Exception in this line
.Height = (80 / 1080) * screenheight
.Width = screenwidth
.Background = New SolidColorBrush(Colors.Transparent)
End With
「ビジュアルがPresentationSourceに接続されていません」という無効な操作例外として例外が発生しています。
私はすでにこの投稿http://social.msdn.microsoft.com/Forums/en/wpf/thread/f3c982a1-ca16-4821-bf08-f6dd8ff8d829 を試しましたが、PointToScreenのみを使用して試したいと思います。
どうすればこれを解決できますか???? 私を助けてください