吾爱破解 - 52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 326|回复: 0
收起左侧

[求助] 帮助中是这样写的:可是。。。

[复制链接]
冥界3大法王 发表于 2024-2-25 12:04
Vcl.Grids.TStringGridStrings.Clear
From RAD Studio API Documentation

  • Up to Parent: TStringGridStrings


Delphi procedure Clear; override;
C++
virtual void __fastcall Clear();Properties
TypeVisibilitySourceUnitParent

procedure
function
public
Vcl.Grids.pas
Vcl.Grids.hpp
Vcl.GridsTStringGridStrings
Description
Replaces all strings in the list with empty strings.
Call Clear to remove all strings from the list, including any references to associated objects. Clear replaces every string with an empty string and every object reference with nil (Delphi) or NULL (C++).
Note that Clear does not free the objects that are associated with strings in the list.



//StringGrid1.clear;       这种写法是错的!

方法1:
with StringGrid1 do
  for i := 0 to ColCount - 1 do
    Cols.Clear;  

方法2:
with StringGrid1 do
    for i := 0 to RowCount - 1 do
      Rows.Clear;

方法3:
    for i := 0 to StringGrid1.RowCount - 1 do
      for j := 0 to StringGrid1.ColCount - 1 do
        StringGrid1.cells[j, i] := '';


那它具体 用在何处呢? 请举出一个实例!

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则

返回列表

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2024-12-14 15:54

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表