没变吧,只是Label与容器的左边缘空白被放大了而已。可以使用Screen类来进行类似转换。例如//获取左边缘的空白相对于当前分辨率的比例
double blankRate = (double)label1.Left / (double)System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width;private override void Refresh()
{
label1.Left = (int)blankRate * label1.Left;
}
double blankRate = (double)label1.Left / (double)System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width;private override void Refresh()
{
label1.Left = (int)blankRate * label1.Left;
}
我都是这么写int w=System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width;
int h=System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height;
//假使label在设计时的坐标是(100,100),分辨率为1440*900
label1.Location=new Point(100*w/1440,100*h/900);
picbox 不是容器 lable的 位置 是相对他的容器的 也就是 panel 或 form
貌似 3楼的 方法 可行。。有待验证。。