Arsip: Capture onClik pada Scroll bar Vertical

 
user image
more 17 years ago

coolmib

Gue mau nampilin sprite dari 1 file yg besar...., terpaksa dipecah , per 1 halaman ditampilan sekian puluh sprite, skg kebingungan u/ mengakali event on klik pada Vertical scroll bar (gak ketemu) yg ada di form tsb. Ada yg tau gimana ngakalinnya
user image
more 17 years ago

ZeAL

kalo pake onChange..???
user image
more 17 years ago

coolmib

OnChange ?? kok gak ketemu di form
user image
more 17 years ago

chipmunk

Apa maksudnya "Click" pada bagian2 tertentu dari scroll bar? klo ga salah tangkap maksudnya coba teknik dibawah ini.. Utk trapping message diluar yg disediakan oleh Control descendents spt TForm, TListBox dll gunakan subclassing utk masuk ke "message terminal" ato "WinProc" Misal utk trapping vertical scrollbar suatu control (TForm, TListBox ..dsb) trap WM_VSCROLL message dari WinProc. Karena kita bekerja di dalam descendent TForm class spt biasanya kita dpt masuk kesitu dg paling tidak 2 cara: 1. Keyword message - Deklarasikan message handler pada form misal :
 procedure WMVScroll( var M: TWMVScroll); message WM_VSCROLL; 
- Implementasikan misal :
procedure TForm1.WMVScroll(var M: TWMVScroll);
begin
  inherited;
  // M.ScrollCode --> liat konstanta di bawah
end;
2. Override WndProc() procedure - Deklarasi
protected
    procedure WndProc(var Message: TMessage); override;
- Implementasi
procedure TForm1.WndProc(var Message: TMessage);
begin
  if (Message.Msg = WM_VSCROLL) then
  begin
    // Lo(Message.WParam) -> liat konstanta di bawah
    //
  end;
  inherited;
end;
ScrollCode: SB_BOTTOM Scrolls to the lower right. SB_ENDSCROLL Ends scroll. SB_LINEDOWN Scrolls one line down. SB_LINEUP Scrolls one line up. SB_PAGEDOWN Scrolls one page down. SB_PAGEUP Scrolls one page up. SB_THUMBPOSITION Scrolls to the absolute position. The current position is specified by the nPos parameter. SB_THUMBTRACK Drags scroll box to the specified position. The current position is specified by the nPos parameter. SB_TOP Scrolls to the upper left. Gunakan konstanta di atas utk mengetahui bagian dari scrollbar yang sesuai dengan keperluan misal SB_LINEDOWN utk click tanda panah bawah... Kedua cara adalah sama, hanya yg pertama dengan bantuan compiler Delphi yang "event aware" Misalnya utk men-trap scrollbar event pada control selain TForm gunakan subclassing, utk penjelasannya bisa dilihat di MSDN, Win32 Help ato buku saya ttg subclassing di: http://www.esnips.com/web/chipmunk-delphi-stuff Happy coding! :) br, Chipmunk
user image
more 17 years ago

coolmib

Wuih..... mantap.... gue coba dulu.....
more ...
  • Pages:
  • 1
Share to
Local Business Directory, Search Engine Submission & SEO Tools FreeWebSubmission.com SonicRun.com