English 中文(简体)
系统. Drawing。 累进式 不得为“底层”或“左”或“权利”或“选择”而找到财产。
原标题:System.Drawing.Rectangle Cannot find property setter for "bottom" or "Left" or "Right" or "Top"

在Delphi Prism,我试图将累tang的特性确定下来,留下了上下层或下层,汇编者不断说,它无法找到一个固定的装置,为累犯确定这些财产的价值。

我已经研究了与此相关的其他中继问题,没有找到一个很好的答案。

我想能够确定它是顶端的、底层的、正确的,或留下能够做以下事情的价值。

dragRect.right := dragRect.left;
dragRect.bottom := dragRect.top;

显然,你可以这样做。 你们如何在德尔菲斯帝国主义方面取得同样的成就?

最佳回答

As Hans Passant pointed out, it is important to understand the difference between value type and reference type. Because System.Drawing.Rectangle doesn t have setters for left, top, right or bottom, you simply can t set any values to them but only read what is already there. The only time they get updated is when you actually create the Rectangle object passing the height, width and X-Y points OR setting X, Y, height and/or width of a rectangle properties.

由于在我的方案中,我只是试图界定划定边界或地区,以图形,我确定了X、Y、宽度或高度。 罚款。 就直径的宽度和高度而言,你一度放大,一度高。 每当你重新确定 rec子的X和(或)Y值时,就保持其宽度和高度。 因此,它知道它的权利和底价值是什么。

For instance, you can do this:

dragRect.X := 100;
dragRect.width := 10;

but you can t do this:

dragRect.left := 100;
dragRect.right :=110;
问题回答

暂无回答




相关问题
Manually implementing high performance algorithms in .NET

As a learning experience I recently tried implementing Quicksort with 3 way partitioning in C#. Apart from needing to add an extra range check on the left/right variables before the recursive call, ...

Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How do I compare two decimals to 10 decimal places?

I m using decimal type (.net), and I want to see if two numbers are equal. But I only want to be accurate to 10 decimal places. For example take these three numbers. I want them all to be equal. 0....

Exception practices when creating a SynchronizationContext?

I m creating an STA version of the SynchronizationContext for use in Windows Workflow 4.0. I m wondering what to do about exceptions when Post-ing callbacks. The SynchronizationContext can be used ...

Show running instance in single instance application

I am building an application with C#. I managed to turn this into a single instance application by checking if the same process is already running. Process[] pname = Process.GetProcessesByName("...

How to combine DataTrigger and EventTrigger?

NOTE I have asked the related question (with an accepted answer): How to combine DataTrigger and Trigger? I think I need to combine an EventTrigger and a DataTrigger to achieve what I m after: when ...

热门标签