按钮上的位置 [英] Location on a button

查看:83
本文介绍了按钮上的位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚接触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

推荐答案

拉尔森,


这篇关于按钮上的位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆