码迷,mamicode.com
首页 > Windows程序 > 详细

C# the SystemParameters, “type or namespace does not exist”

时间:2018-02-21 22:18:58      阅读:255      评论:0      收藏:0      [点我收藏+]

标签:href   frame   height   find   sse   任务   form   round   ace   

 the SystemParameters, “type or namespace does not exist” 解决方法

* add a project reference

  • In Solution Explorer, expand the project, right click on References and click Add Reference.
  • Now click Browse on the bottom, find the DLL you are trying to use. In this case it should be included under Assemblies - Framework. Click on Framework on the left menu.
  • Find PresentationFramework on the right. Make sure you Check mark it
  • Click OK.

Now you have the reference, go back to your code and it should work. Again, make sure you create a WPF Project not WinForms...

using System.Windows.Forms in your code.

 

REF:

https://stackoverflow.com/questions/22026116/c-sharp-cant-use-the-systemparameters-type-or-namespace-does-not-exist

 

 

其他:

WinForm

   //获取PC屏幕的宽
        int width = Screen.PrimaryScreen.Bounds.Width;
  //获取PC屏幕的高
        int height = Screen.PrimaryScreen.Bounds.Height;

Screen.PrimaryScreen.WorkingArea.Height;

Screen.PrimaryScreen.WorkingArea.Width;

 

WPF

SystemParameters.WorkArea;//除任务栏外工作区大小
SystemParameters.PrimaryScreenWidth;//屏幕宽
SystemParameters.PrimaryScreenHeight;//屏幕高

double dWidth2 = ActualWidth; //获取此元素的呈现宽度。若此元素时全屏的,则可以获得屏幕大小

double dHeight2 = ActualHeight; //获取此元素的呈现高度。

C# the SystemParameters, “type or namespace does not exist”

标签:href   frame   height   find   sse   任务   form   round   ace   

原文地址:https://www.cnblogs.com/watermarks/p/8457495.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!