Einzelnen Beitrag anzeigen

Volker Z.

Registriert seit: 3. Dez 2012
Ort: Augsburg, Bayern, Süddeutschland
419 Beiträge
 
Delphi XE4 Ultimate
 
#4

AW: ListView - automatische Spaltenbreite-Anpassung abfangen

  Alt 23. Jan 2013, 22:07
Hallo,

Du könntest mal folgendes Versuchen:

Delphi-Quellcode:
type
  TListView = class (Vcl.ComCtrls.TListView)
  private
    procedure WMNotify (var Msg : TWMNotify); message WM_NOTIFY;
  protected
    procedure KeyDown (var Key : Word; Shift : TShiftState); override;
  end;
im Interfaceteil Deiner Form deklarieren und

Delphi-Quellcode:
uses
  Winapi.CommCtrl;

procedure TListView.WMNotify (var Msg : TWMNotify);
begin
  if Msg.NMHdr.code = HDN_DIVIDERDBLCLICK then
    Exit;

  inherited
end;

procedure TListView.KeyDown (var Key : Word; Shift : TShiftState);
begin
  if (ssShift in Shift) and (ssCtrl in Shift) and (Key = VK_ADD) then
    Key := 0
end;
in Deinen Implementationsteil. Sollte es mit HDN_DIVIDERDBLCLICK nicht klappen, dann versuch es mit HDN_DIVIDERDBLCLICKW Gruß
Volker Zeller
  Mit Zitat antworten Zitat