Delphi:框架属性不要更新,当我期望他们(他们被卡住) [英] Delphi: frame properties do not update when I expect them to (they get stuck)

查看:255
本文介绍了Delphi:框架属性不要更新,当我期望他们(他们被卡住)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在表单上有一个框架。当我更改框架(添加/删除按钮,标签)时,表单上不会出现更改,或者控件具有框架中其他位置。如果从表单中删除框架并再次添加 - > Ok。



为什么?我记得在Delphi 2010(现在是Delphi XE)中没有问题。



谢谢。

解决方案

所以你创建了一个框架,然后把一个实例放在另一个窗体上,问题在于,在删除实例之前不会立即显示对原始框架的更改, -算了吧?



您不需要删除框架,只需右键单击并选择要使其属性来自其主(原始框架)属性的控件,然后单击还原为继承。奇怪的是,全选不起作用。



这是我避免框架的原因之一。我希望框架有一个不允许自定义属性(AllowCustom = false),通过不允许框架具有这种奇怪的双重属性来阻止任何设计时间DFM冲突。



标准化框架的另一种方法是右键单击并将表单视为文本,并将框架缩小到:

  inline Frame61:TMyFrame61 
Left = 0
顶部= 0
宽度= 500
高度= 500
Align = alNone
TabOrder = 0
ExplicitLeft = 31
ExplicitTop = 33
end

现在不包含任何覆盖的属性。



如果我拖动其他控件(甚至意外),则会在框架已被删除的DFM中发生以下情况: / p>

 内联Frame61:TMyFrame6 
左= 0
顶部= 0
宽度= 500
Height = 500
Align = alNone
TabOrder = 0
ExplicitW idth = 527
ExplicitHeight = 337
继承编辑2:TEdit
左= 19
顶部= 77
ExplicitLeft = 19
ExplicitTop = 77
end
end

DFM中的这些额外的东西会干扰你在另一个层次。通常添加额外的控件和删除控件是没有问题的(额外的控件应该显示添加时,自动和删除的控件应该消失),但是与定位问题(控制重叠/等)的影响,效果可能是你不直到后来才能看到这个变化。


I have a frame on a form. When I change the frame (add/delete buttons, labels) no changes appear on the form or controls have other positions in the form that in the frame. If to delete the frame from the form and add it again -> Ok.

Why? As I remember there were no problems in Delphi 2010 (now-Delphi XE).

Thanks.

解决方案

So you had created a frame, and then dropped an instance of it on another form, and the problem is that later changes made to the original frame are not immediately shown until you delete the instance and re-drop it?

You don't need to delete the frame, just right click and select the controls you want to have their properties come from their master (original frame) properties, and click Revert to inherited. Oddly enough, Select All doesn't work in frames.

This is one of the reasons I avoid frames. I wish frames had a "don't allow customization" property (AllowCustom=false) that would prevent any designtime DFM conflicts by not allowing frames to have this weird double-sets-of-properties.

Another way to normalize your frames is to right click and view the form as text, and reduce your frame to this:

 inline Frame61: TMyFrame61
    Left = 0
    Top = 0
    Width = 500
    Height = 500
    Align = alNone
    TabOrder = 0
    ExplicitLeft = 31
    ExplicitTop = 33
  end

Now it contains no overridden properties at all.

If I drag one of the controls somewhere else (even accidentally), the following happens in the DFM where the Frame has been dropped:

 inline Frame61: TMyFrame6
    Left = 0
    Top = 0
    Width = 500
    Height = 500
    Align = alNone
    TabOrder = 0
    ExplicitWidth = 527
    ExplicitHeight = 337
    inherited Edit2: TEdit
      Left = 19
      Top = 77
      ExplicitLeft = 19
      ExplicitTop = 77
    end   
  end

These extra bits of stuff in the DFM interfere with changes that you made at the other level. Normally adding extra controls and deleting controls is no problem (extra controls should show up when added, automatically, and deleted controls should go away), but with the effects of positioning problems (control overlaps/etc) the effect can be that you don't see the change until later.

这篇关于Delphi:框架属性不要更新,当我期望他们(他们被卡住)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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