任务栏的位置 怎么判断任务栏的位置 就是它是在屏幕的区域 左还是右 上还是下 以及它的高度或宽度 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 Screen.GetWorkingArea.GetBounds()检查左上角的点和宽度左上角 宽度0 小于屏幕宽度 任务栏在右0 等于屏幕宽度 下>0 小于 左>0 等于 上 Screen.GetWorkingArea.GetBounds()进行判断 用SystemInformation.WorkingArea和Screen.PrimaryScreen.Bounds进行判断。SystemInformation.WorkingArea.Y>0:任务栏在上方SystemInformation.WorkingArea.X>0:任务栏在左边SystemInformation.WorkingArea.Right<Screen.PrimaryScreen.Bounds.Width:任务栏在右边SystemInformation.WorkingArea.Bottom<Screen.PrimaryScreen.Bounds.Height:任务栏在下方 SystemInformation.WorkingAreaScreen.PrimaryScreen.Bounds 我写的代码如下 看看有没有问题 public struct 任务栏型 { public 任务栏位置 位置; public int height; }; public 任务栏型 Get任务栏() { 任务栏型 任务栏temp; 任务栏temp.位置 = 任务栏位置.上; 任务栏temp.height = 24; Rectangle rt = SystemInformation.WorkingArea; Rectangle rt1 = Screen.PrimaryScreen.Bounds; if (rt.Y > 0) { 任务栏temp.位置 = 任务栏位置.上; 任务栏temp.height = Math.Abs(rt1.Height - rt.Height); } if (rt.X > 0) { 任务栏temp.位置 = 任务栏位置.左; 任务栏temp.height = Math.Abs(rt1.Width - rt.Width); } if (rt.Right < rt1.Width) { 任务栏temp.位置 = 任务栏位置.右; 任务栏temp.height = Math.Abs(rt1.Width - rt.Width); } if (rt.Bottom < rt1.Height) { 任务栏temp.位置 = 任务栏位置.下; 任务栏temp.height = Math.Abs(rt1.Height - rt.Height); } return 任务栏temp; } GID问题 正则问题!怎么获取""号里的内容? winform中如何写渐变窗体............ vs2008最近打开项目越来越慢。应该对哪里做下清理呢? 懂正则表达式的帮忙 C#与javascript 英文版 winxp,安装 vs.net2003 中文 提示组件不一致? C# 怎么实现 局域网内文件共享下载 lhgdialog 看书看到配件、属性信息、元数据等概念感觉特别迷茫,求助。。。 一个解决方案下面可不可以 字符串转decimal以及decimal格式化输出
检查左上角的点和宽度
左上角 宽度
0 小于屏幕宽度 任务栏在右
0 等于屏幕宽度 下
>0 小于 左
>0 等于 上
SystemInformation.WorkingArea.Y>0:任务栏在上方
SystemInformation.WorkingArea.X>0:任务栏在左边
SystemInformation.WorkingArea.Right<Screen.PrimaryScreen.Bounds.Width:任务栏在右边
SystemInformation.WorkingArea.Bottom<Screen.PrimaryScreen.Bounds.Height:任务栏在下方
Screen.PrimaryScreen.Bounds
public struct 任务栏型
{
public 任务栏位置 位置;
public int height; }; public 任务栏型 Get任务栏()
{
任务栏型 任务栏temp;
任务栏temp.位置 = 任务栏位置.上;
任务栏temp.height = 24; Rectangle rt = SystemInformation.WorkingArea;
Rectangle rt1 = Screen.PrimaryScreen.Bounds;
if (rt.Y > 0)
{
任务栏temp.位置 = 任务栏位置.上;
任务栏temp.height = Math.Abs(rt1.Height - rt.Height);
}
if (rt.X > 0)
{
任务栏temp.位置 = 任务栏位置.左;
任务栏temp.height = Math.Abs(rt1.Width - rt.Width);
}
if (rt.Right < rt1.Width)
{
任务栏temp.位置 = 任务栏位置.右;
任务栏temp.height = Math.Abs(rt1.Width - rt.Width);
}
if (rt.Bottom < rt1.Height)
{
任务栏temp.位置 = 任务栏位置.下;
任务栏temp.height = Math.Abs(rt1.Height - rt.Height);
}
return 任务栏temp;
}