with ... do //开域语句
Canvas//画布
Canvas.Brush//底图with MyTreeView.Canvas do
begin
{}Brush.Color := m_BkgColorDialog.Color; //相当于MyTreeView.Canvas.Brush.Color := m_BkgColorDialog.Color;
{}FillRect(ARect); //相当于MyTreeView.Canvas.FillRect
end;
Canvas//画布
Canvas.Brush//底图with MyTreeView.Canvas do
begin
{}Brush.Color := m_BkgColorDialog.Color; //相当于MyTreeView.Canvas.Brush.Color := m_BkgColorDialog.Color;
{}FillRect(ARect); //相当于MyTreeView.Canvas.FillRect
end;
{}ShowModal;
finally
{}Free;
end;
2,fillrect() 是对API
2,fillrect() 是对API其封装。将其做成画布函数。可以看源码:CTRL + 点击”你想看的关键字“