求教如何自动调整列宽?
已经比较好看了,但是列宽不满意。unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Grids;
type
TForm1 = class(TForm)
StringGrid1: TStringGrid;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
arr:array of string;
i,j:integer;
begin
StringGrid1.ColWidths := 88;
StringGrid1.ColWidths := 110;
StringGrid1.ColWidths := 166;
StringGrid1.ColWidths := 166;
StringGrid1.ColWidths := 180;
arr := '转移类别';
arr := '标志位';
arr := '含义';
arr := '短转移指令';
arr := '长转移指令';
arr := 'call';
arr := 'jmp';
arr := 'jo';
arr := 'jno';
arr := 'jb/jc/jnae';
arr := 'jae/jnb/jnc';
arr := 'je/jz';
arr := 'jne/jnz';
arr := 'jbe/jna';
arr := 'ja/jnbe';
arr := 'js';
arr := 'jns';
arr := 'jp/jpe';
arr := 'jnp/jpo';
arr := 'jl/jnge';
arr := 'jge/jnl';
arr := 'jle/jng';
arr := 'jg/jnle';
arr := '-';
arr := '-';
arr := 'OF=1';
arr := 'OF=0';
arr := 'CF=1';
arr := 'CF=0';
arr := 'ZF=1';
arr := 'ZF=0';
arr := 'CF=1或ZF=1';
arr := 'CF=0或ZF=0';
arr := 'SF=1';
arr := 'SF=0';
arr := 'PF=1';
arr := 'PF=0';
arr := 'SF≠OF';
arr := 'SF=OF';
arr := 'SF≠0F或ZF=1';
arr := 'SF=OF且ZF=0';
arr := 'call调用指令';
arr := '无条件转移';
arr := '溢出';
arr := '无溢出';
arr := '低于/进位/不高于等于';
arr := '高于等于/不低于/无进位';
arr := '相等/等于0';
arr := '不相等/不等于0';
arr := '低于等于/不高于';
arr := '高于/不低于等于';
arr := '符号为负';
arr := '符号为正';
arr := '1的个数为偶';
arr := '1的个数为奇';
arr := '小于/不大于等于';
arr := '大于等于/不小于';
arr := '小于等于/不大于';
arr := '大于/不小于等于';
arr := 'E8xxxxxx';
arr := 'EBxx';
arr := '70xx';
arr := '71xx';
arr := '72xx';
arr := '73xx';
arr := '74xx';
arr := '75xx';
arr := '76xx';
arr := '77xx';
arr := '78xx';
arr := '79xx';
arr := '7Axx';
arr := '7Bxx';
arr := '7Cxx';
arr := '7Dxx';
arr := '7Exx';
arr := '7Fxx';
arr := 'E8xxxxxx';
arr := 'E9xxxxxx';
arr := '0F80xxxx';
arr := '0F81xxxx';
arr := '0F82xxxx';
arr := '0F83xxxx';
arr := '0F84xxxx';
arr := '0F85xxxx';
arr := '0F86xxxx';
arr := '0F87xxxx';
arr := '0F88xxxx';
arr := '0F89xxxx';
arr := '0F8Axxxx';
arr := '0F8Bxxxx';
arr := '0F8Cxxxx';
arr := '0F8Dxxxx';
arr := '0F8Exxxx';
arr := '0F8Fxxxx';
StringGrid1.ColCount:=6;
StringGrid1.RowCount:=19;
StringGrid1.ColWidths:=0;
for i:=Low(arr) to High(arr) do
for j:= Low(arr)+1 to High(arr)+1 do
begin
StringGrid1.Cells:=arr
end;
end;
end.
技术帖,不懂得,我以为是Excel表格呢,原来你这个是VBA自动 本帖最后由 冥界3大法王 于 2019-8-11 10:28 编辑
知道了
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Grids;
type
TForm1 = class(TForm)
StringGrid1: TStringGrid;
Button1: TButton;
Button2: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
arr:array of string;
i,j:integer;
begin
arr := '转移类别';
arr := '标志位';
arr := '含义';
arr := '短转移指令';
arr := '长转移指令';
arr := 'call';
arr := 'jmp';
arr := 'jo';
arr := 'jno';
arr := 'jb/jc/jnae';
arr := 'jae/jnb/jnc';
arr := 'je/jz';
arr := 'jne/jnz';
arr := 'jbe/jna';
arr := 'ja/jnbe';
arr := 'js';
arr := 'jns';
arr := 'jp/jpe';
arr := 'jnp/jpo';
arr := 'jl/jnge';
arr := 'jge/jnl';
arr := 'jle/jng';
arr := 'jg/jnle';
arr := '-';
arr := '-';
arr := 'OF=1';
arr := 'OF=0';
arr := 'CF=1';
arr := 'CF=0';
arr := 'ZF=1';
arr := 'ZF=0';
arr := 'CF=1或ZF=1';
arr := 'CF=0或ZF=0';
arr := 'SF=1';
arr := 'SF=0';
arr := 'PF=1';
arr := 'PF=0';
arr := 'SF≠OF';
arr := 'SF=OF';
arr := 'SF≠0F或ZF=1';
arr := 'SF=OF且ZF=0';
arr := 'call调用指令';
arr := '无条件转移';
arr := '溢出';
arr := '无溢出';
arr := '低于/进位/不高于等于';
arr := '高于等于/不低于/无进位';
arr := '相等/等于0';
arr := '不相等/不等于0';
arr := '低于等于/不高于';
arr := '高于/不低于等于';
arr := '符号为负';
arr := '符号为正';
arr := '1的个数为偶';
arr := '1的个数为奇';
arr := '小于/不大于等于';
arr := '大于等于/不小于';
arr := '小于等于/不大于';
arr := '大于/不小于等于';
arr := 'E8xxxxxx';
arr := 'EBxx';
arr := '70xx';
arr := '71xx';
arr := '72xx';
arr := '73xx';
arr := '74xx';
arr := '75xx';
arr := '76xx';
arr := '77xx';
arr := '78xx';
arr := '79xx';
arr := '7Axx';
arr := '7Bxx';
arr := '7Cxx';
arr := '7Dxx';
arr := '7Exx';
arr := '7Fxx';
arr := 'E8xxxxxx';
arr := 'E9xxxxxx';
arr := '0F80xxxx';
arr := '0F81xxxx';
arr := '0F82xxxx';
arr := '0F83xxxx';
arr := '0F84xxxx';
arr := '0F85xxxx';
arr := '0F86xxxx';
arr := '0F87xxxx';
arr := '0F88xxxx';
arr := '0F89xxxx';
arr := '0F8Axxxx';
arr := '0F8Bxxxx';
arr := '0F8Cxxxx';
arr := '0F8Dxxxx';
arr := '0F8Exxxx';
arr := '0F8Fxxxx';
StringGrid1.ColCount:=6;
StringGrid1.RowCount:=19;
StringGrid1.ColWidths:=0;
for i:=Low(arr) to High(arr) do
for j:= Low(arr)+1 to High(arr)+1 do
begin
StringGrid1.Cells:=arr
end;
StringGrid1.ColWidths := 0;
StringGrid1.ColWidths := 110;
StringGrid1.ColWidths := 166;
StringGrid1.ColWidths := 166;
StringGrid1.ColWidths := 90;
StringGrid1.ColWidths := 90;
end;
end.
这样就OK了。 看不懂 都是大佬 jackroc 发表于 2019-8-11 10:28
看不懂 都是大佬
和沙发一样的实在。生活中肯定好骗的很。{:301_1008:} 收藏学习了{:1_919:} 不知道这事啥 DELPHI7学习中。。。。。 记得楼主之前装的xe什么的,怎么又用回d7了
页:
[1]