解决方案 »
- 我想修改windows登录窗口,在里面加个下拉列表
- 如何获得汉字的utf-8的十六进制的内码?
- 请问关于frReport报表的一个小问题~~!!
- 求助:有两个Form:Form1,Fom2。Form1是自动生成的,Form2由Form1在程序运行时Create。请问该怎么做?
- 数据库是acess2000,为什么这句话也执行错误了呢?
- 如何禁止DGawGrid里的scroll滚动条滚动.急啊.
- 网络问题
- 求助....怎样实现Delphi后台驱动Auto CAD..在线等待!
- 串口通讯问题。。。。
- 用Delphi能不能写出专业的发射机,空调,电动机,水泵......
- 关于MDI窗体显示位置的问题
- DataSource2DataChange(sender); 这个事件怎么写
为sgdForUnits的事件名即可:
......
type
TF_FrameStringGrid = class(TFrame)
GroupBox1: TGroupBox;
sgdForUnits: TStringGrid;
GroupBox2: TGroupBox;
sgdUnits: TStringGrid;
GroupBox3: TGroupBox;
sgdRectify: TStringGrid;
procedure sgdForUnitsClick(Sender: TObject);
procedure sgdForUnitsDrawCell(Sender: TObject; ACol, ARow: Integer;
Rect: TRect; State: TGridDrawState);
private
{ Private declarations }
public
{ Public declarations }
end;implementation{$R *.dfm}procedure TF_FrameStringGrid.sgdForUnitsClick(Sender: TObject);
begin
TStringGrid(Sender).RowCount := TStringGrid(Sender).RowCount + 1;
end;procedure TF_FrameStringGrid.sgdForUnitsDrawCell(Sender: TObject; ACol,
ARow: Integer; Rect: TRect; State: TGridDrawState);
begin
with TStringGrid(Sender).Canvas do begin
Pen.Color := clRed;
Brush.Style := bsClear;
Rectangle(Rect);
end;
end;
......
F_BaseHiddenSet.Height := 656;
F_BaseHiddenSet.Width := 763;
F_DataModule.ADOTable1.TableName := 'HiddenSet';
F_DataModule.ADOTable1.Open; F_FrameStringGrid.sgdForUnits.Cells[0,0] := '被检单位';
F_FrameStringGrid.sgdForUnits.Cells[1,0] := '负 责 人'; F_FrameStringGrid.sgdUnits.Cells[0,0] := '检查单位';
F_FrameStringGrid.sgdUnits.Cells[1,0] := '负 责 人'; F_FrameStringGrid.sgdRectify.Cells[0,0] := '整改期限';
F_FrameStringGrid.sgdRectify.Cells[1,0] := '整改结果';放在 F_BaseHiddenSet 的 Show 事件或 Create 事件中:procedure TF_BaseHiddenSet.FormCreate(Sender: TObject);
begin
Height := 656;
Width := 763;
F_DataModule.ADOTable1.TableName := 'HiddenSet';
F_DataModule.ADOTable1.Open;
F_FrameStringGrid:=TF_FrameStringGrid.Create(self);
with F_FrameStringGrid do begin
Parent:=F_BaseHiddenSet;
sgdForUnits.Cells[0,0] := '被检单位';
sgdForUnits.Cells[1,0] := '负 责 人';
sgdUnits.Cells[0,0] := '检查单位';
sgdUnits.Cells[1,0] := '负 责 人';
sgdRectify.Cells[0,0] := '整改期限';
sgdRectify.Cells[1,0] := '整改结果';
end;
end;
将这些代码放在FormCreate中不行,出现“Access violation at address 005F98BF in module 'AirManageSystem.exe'.Read of address 000002A0”。这是个什么错误,一般是什么原因导致的?
Forms,
Main in 'Main.pas' {F_Main},
Base in 'Base.pas' {F_BaseForm},
DataModule in 'DataModule.pas' {F_DataModule: TDataModule},
HiddenDanger in 'HiddenDanger.pas' {F_HiddenDanger},
HiddenInput in 'HiddenInput.pas' {F_HiddenInput},
FrameGroup in 'FrameGroup.pas' {F_FrameGroup: TFrame},
FrameGroup2 in 'FrameGroup2.pas' {F_FrameGroupUnit: TFrame},
InhFramGroup in 'InhFramGroup.pas' {F_InhFram_Group: TFrame},
BaseSet in 'BaseSet.pas' {F_SystemSet},
HiddenSet in 'HiddenSet.pas' {F_HiddenSet},
BaseSystemSet in 'BaseSystemSet.pas' {F_BaseSystemSet},
BaseHiddenSet in 'BaseHiddenSet.pas' {F_BaseHiddenSet},
InhFramGroup2 in 'InhFramGroup2.pas' {F_FrameStringGrid: TFrame};{$R *.res}begin
Application.Initialize;
Application.MainFormOnTaskbar := True;
Application.CreateForm(TF_Main, F_Main);
Application.CreateForm(TF_BaseForm, F_BaseForm);
Application.CreateForm(TF_DataModule, F_DataModule);
Application.CreateForm(TF_HiddenDanger, F_HiddenDanger);
Application.CreateForm(TF_HiddenInput, F_HiddenInput);
Application.CreateForm(TF_SystemSet, F_SystemSet);
Application.CreateForm(TF_HiddenSet, F_HiddenSet);
Application.CreateForm(TF_BaseSystemSet, F_BaseSystemSet);
Application.CreateForm(TF_BaseHiddenSet, F_BaseHiddenSet);
Application.Run;
end.窗体是F_BaseHiddenSet。
这个文章应该有帮助,不过需要一个个获取,LZ可以自己动动手