zoukankan      html  css  js  c++  java
  • Delhi 动态创建TImage控件的删除

    //双重保险,TImage对象有时候使用FindControl时候释放不掉 而其他类型的控件时可以的。
        self.ScrollBox1.FindComponent(global.ItemIDList.Strings[i]).Free;
        (self.ScrollBox1 as TScrollBox).FindChildControl(global.ItemIDList.Strings[i]).Free;

    以上代码无法删掉动态创建的TImage对象,双重保险也不管用。

    //真正起作用的是下面的代码  上面的完全失效 释放不掉
    with (self.ScrollBox1 as TScrollBox) do
    begin
        for i:=ControlCount-1 downto 0 do
         if (uppercase(Controls[i].Name)<>uppercase('BackgroundImage')) and (uppercase(Controls[i].ClassName)=uppercase('TImage')) then
               Controls[i].Free;

    end;

  • 相关阅读:
    @bzoj
    @hdu
    @noi.ac
    @noi.ac
    @noi.ac
    jsp include page指令标记
    javascript 对象(DOM)document window history
    HTML 标准属性 和 事件属性
    html 特殊字符 fmt table A
    mysql 启动 导入sql文件
  • 原文地址:https://www.cnblogs.com/xyicheng/p/1654183.html
Copyright © 2011-2022 走看看