问题描述
我刚接触C#,遇到了一个问题.
假设我有两个按钮,Button1和Button2.
我想在那里找到
this.Button1.Location =新的System.Drawing.Point(73,139);
this.Button2.Location =新的System.Drawing.点(73,Button1.Location.Y + 50);这样,它在Button1之外总是有50个点.
我可以从previos项目中回忆起,我一直认为它应该可以工作,但是由于某些原因却不能.我在使用的地方对此进行了一项测试:
this.Button2.Location = new System.Drawing.Point(78,100 + 50); :仅在使用了"100"的情况下设置为"100 + 50",则忽略了"+ 50",
我将在文件Längd.Designer.cs"中进行更改,在Längd"中可以正常使用. resx"
我要这样做,所以如果Button1移开,button2就会跟着.
//拉尔森,不好意思的英语
I am quite new to C#, and i have got a problem.
Let's say i got two button, Button1 and Button2.
And i want there location to be something like this.
this.Button1.Location = new System.Drawing.Point (73, 139);
this.Button2.Location = new System.Drawing.Point (73, Button1.Location.Y + 50); so that it is always 50 dots aside from Button1.
As i can recall from previos projects i have been up to it should work, but for some reason it does't. I did one test on this where i used:
this.Button2.Location = new System.Drawing.Point (78, 100 + 50); : Where it just used "100" insted of "100 + 50", it ignored "+ 50",
I'll change this in the file "Längd.Designer.cs", it works fine in "Längd.resx"
I want to do this so if Button1 is moved button2 will follow.
// Larsson, excuse my bad english
推荐答案
这篇关于按钮上的位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!