小弟刚学delphi,从http://www.pudn.com/downloads37/sourcecode/windows/database/detail124076.html下来一题库与试卷系统研究学习,但BYSJ.dpr编译到ZJID:=GetMidStr(SDZJ_CT.Selected.Text,'',' '); 就停止了,出现如下提示:
[错误] Main_Form.pas(731): Undeclared identifier: 'GetMidStr'
[错误] Main_Form.pas(780): Incompatible types: 'Integer' and 'TTreeNode'
[错误] Main_Form.pas(1413): Undeclared identifier: 'Wait'
[错误] Main_Form.pas(1548): Undeclared identifier: 'Wait'
[错误] Main_Form.pas(3036): Undeclared identifier: 'wait'
[错误] Main_Form.pas(3378): Undeclared identifier: 'Wait'
[致命错误] BYSJ.dpr(16): Could not compile used unit 'Main_Form.pas'貌似与下面有关:
在设计时因TTreeView里有一个StateIndex和StateImages,而纵观TTreeView的代码可以知道它只是发布了一下TCustomTreeView定义并实现好的属性和方法而已。因此我们也选择TCustomTreeView为TCheckTree控件的祖先类。
重要的实现技术为:
procedure TCheckTree.WMPaint( var Msg: TWMPaint );
var
  I: Integer;
begin
  for I := 0 to Items.Count - 1 do
    begin                           
    if not(Items[ I ].StateIndex in [Ord(csUnknown)..Ord(csPartiallyChecked)]) then
      Items[ I ].StateIndex := Ord(csUnchecked)       //这里我修改了
  end;
  inherited;
end;
function TCheckTree.GetItemState( Node:TTreeNode ): TCheckCheckState;
begin
  Result := TCheckCheckState( Node.StateIndex );
end;
procedure TCheckTree.SetItemState( Node:TTreeNode; Value: TCheckCheckState );
begin
  if TCheckCheckState( Node.StateIndex ) <> Value then
    ChangeNodeCheckState( Node, Value );
end;
procedure TCheckTree.StateChange( Node: TTreeNode; NewState: TCheckCheckState );
begin
  if Assigned( FOnStateChange ) then
    FOnStateChange( Self, Node, NewState );
end;反复演当,就是通不过,都快崩溃了,请大侠指点迷津!在下成分感谢!