> ほかになにか方法が方法がありますでしょうか?
こういうのでしょうか?
https://codeverge.com/embarcadero.delphi.vcl.using/hiding-scrollbars-for-dbctrlgrid/1067707次のようなユニットを作っておき、
unit uHideScrollbars;
interface
uses
Winapi.Windows, Winapi.Messages, Vcl.DBCGrids;
type
TDBCtrlGrid = class(Vcl.DBCGrids.TDBCtrlGrid)
private
procedure WMNCCalcSize(var msg: TMessage); message WM_NCCALCSIZE;
end;
implementation
{ TDBCtrlGrid }
procedure TDBCtrlGrid.WMNCCalcSize(var msg: TMessage);
begin
var Style := getWindowLong(Handle, GWL_STYLE);
if (Style and WS_HSCROLL) <> 0 then
SetWindowLong(Handle, GWL_STYLE, Style and not WS_HSCROLL);
if (Style and WS_VSCROLL) <> 0 then
SetWindowLong(Handle, GWL_STYLE, Style and not WS_VSCROLL);
inherited;
end;
end.
スクロールバーを消したい
TDBCtrlGrid が載ったフォームユニットの uses 句で、
Vcl.DBCGrids よりも後に
uHideScrollbars を指定すればいいかと思います。
DEKO