View Issue Details

IDProjectCategoryView StatusLast Update
0003695JEDI VCL00 JVCL Componentspublic2006-09-29 07:36
Reporterir2000Assigned Toobones 
PrioritynormalSeverityfeatureReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.20 
Target VersionFixed in Version3.30 
Summary0003695: TJvDBGrid Scrollbars
DescriptionWould be nice to be able to turn of scrollbars (mainly vertical) when there are only a few records to displayed
TagsNo tags attached.

Activities

obones

2006-06-09 02:45

administrator   ~0009518

Can this be done in a regular TDBGrid?

ir2000

2006-06-09 10:35

reporter   ~0009559

I dont know exactly but I think it is not possible.

obones

2006-07-29 07:44

administrator   ~0009907

Well then, if it's not possible in TDBGrid, it won't be in TJvDBGrid.

ir2000

2006-08-24 09:20

reporter   ~0010021

I had a little time and found a way.

http://www.swissdelphicenter.ch/de/showcode.php?id=1880

Author: P. Below

(*

Q:
I want to hide the vertical scrollbar on a dbgrid when the record count
exceed a number. How can I do that?

A:
Make a descendent of the TDBGrid class. Add a handler for the
WM_NCCALCSIZE message.

*)

type
  TNoScrollDBGrid = class(TDBGrid)
  private
    procedure WMNCCalcSize(var Msg: TMessage);
      message WM_NCCALCSIZE;
  end;

procedure TNoScrollDBGrid.WMNCCalcSize(var Msg: TMessage);
const
  Scrollstyles = WS_VSCROLL or WS_HSCROLL;
var
  Style: Integer;
begin
  Style := GetWindowLong(Handle, GWL_STYLE);
  if (Style and Scrollstyles) <> 0 then
    SetWindowLong(Handle, GWL_STYLE, Style and not Scrollstyles);
  inherited;
end;

//This removes both scrollbars. If you want to remove only the vertical one
//change the scrollstyles constant accordingly.

obones

2006-09-29 07:36

administrator   ~0010248

The ScrollBars property has been added as a public property, use it at will.

Issue History

Date Modified Username Field Change
2006-05-09 08:04 ir2000 New Issue
2006-06-09 02:45 obones Note Added: 0009518
2006-06-09 02:45 obones Status new => feedback
2006-06-09 10:35 ir2000 Note Added: 0009559
2006-07-29 07:44 obones Status feedback => resolved
2006-07-29 07:44 obones Resolution open => not fixable
2006-07-29 07:44 obones Assigned To => obones
2006-07-29 07:44 obones Note Added: 0009907
2006-08-24 09:20 ir2000 Status resolved => feedback
2006-08-24 09:20 ir2000 Resolution not fixable => reopened
2006-08-24 09:20 ir2000 Note Added: 0010021
2006-09-29 07:36 obones Status feedback => resolved
2006-09-29 07:36 obones Fixed in Version => Daily / SVN
2006-09-29 07:36 obones Resolution reopened => fixed
2006-09-29 07:36 obones Note Added: 0010248