有时候在编程过程中由于实际需要,需要移除DBGrid的垂直滚动条,但是有很多的新手不知道这么做,下面我们给出移除DBGrid的垂直滚动条的源代码
<P class=content style=""MARGIN: " 0px\? 2px 4px>type
TNoVertScrollDBGrid = class(TDBGrid)
protected
procedure Paint; override;
end;
procedure Register;
implementation
procedure TNoVertScrollDBGrid.Paint;
begin
SetScrollRange(Self.Handle, SB_VERT, 0, 0, False);
inherited Paint;
end;
procedure Register;
begin
RegisterComponents(\’Data Controls\’, [TNoVertScrollDBGrid]);
end;
end.
<P class=content style=""MARGIN: " 0px\? 2px 4px> 其实很简单的吧 呵呵,觉得好就收藏了哦,说不定下次又要用到的哦~
责任编辑:小草