TDBCtrlGrid No Scroll Bar Component Problem

Using the technical information artical concering getting rid of the Scroll
Bar on a TDBGrid  on the Inprise Website I attempted to get this to work for
TDBCtrlGrid if the number of records in the DataSet where less that the
RowCount property of the TDBCtrlGrid.

I have two problems

(a)    The scrollbar 'flashes' every time the focus changes form on panel to
another.

(b)    If I open the dataset but don't specifically make the DataSet active
before the Control Grid is displayed then only the scroll bar shows.

All help gratefully received, full code below:

unit utTNSDBCtrlGrid;

interface

uses  WinTypes, WinProcs, Classes, DBCGrids, db;

type
  TNSDBCtrlGrid = class(TDBCtrlGrid)
  protected
    procedure PaintWindow(DC: HDC); override;
  end;

procedure Register;

implementation

procedure TNSDBCtrlGrid.PaintWindow(DC: HDC);
begin
     try
        if (DataSource.State <> dsInactive) then
        begin
             if (DataSource.Dataset.RecordCount < RowCount) then
             begin
                  SetScrollRange(Self.Handle, SB_VERT, 0, 0, False);
             end;
        end;
     finally
        inherited PaintWindow(DC);
     end;
end;

procedure Register;
begin
  RegisterComponents('Data Controls', [TNSDBCtrlGrid]);
end;

end.