'TListView'에 해당되는 글 1건

  1. 2012.10.23 TListView 스크롤바 없애기

TListView 스크롤바 없애기

APP 2012. 10. 23. 20:08 |
 
type
  TForm1 = class(TForm)
    ListView1: TListView;
    procedure FormCreate(Sender: TObject);
    procedure FormDestroy(Sender: TObject);
  private
    FListViewWndProc: TWndMethod;
    procedure ListViewWndProc(var Msg: TMessage);
  public
   { Private declarations }
    FShowHoriz: Boolean;
    FShowVert: Boolean;
  end;
  
var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.ListViewWndProc(var Msg: TMessage);
begin
  ShowScrollBar(ListView1.Handle, SB_HORZ, FShowHoriz);
  ShowScrollBar(ListView1.Handle, SB_VERT, FShowVert);
  FListViewWndProc(Msg); // process message
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
  FShowHoriz := True; // show the horiz scrollbar
  FShowVert := False; // hide vert scrollbar
  FListViewWndProc := ListView1.WindowProc; // save old window proc
  ListView1.WindowProc := ListViewWndProc; // subclass
end;

procedure TForm1.FormDestroy(Sender: TObject);
begin
  ListView1.WindowProc := FListViewWndProc; // restore window proc
  FListViewWndProc := nil;
end;


'APP' 카테고리의 다른 글

중복 실행 방지  (0) 2012.10.23
Static 변수 사용하기  (0) 2012.10.23
바탕화면, 즐겨찾기, 내 문서 등의 경로얻기  (0) 2012.10.23
GUID 생성  (0) 2012.10.23
현재 떠있는 모든 창 캡션 구하기  (0) 2012.10.23
Posted by ezmind
: