Einzelnen Beitrag anzeigen

Benutzerbild von APP
APP

Registriert seit: 24. Feb 2003
Ort: Graz (A)
705 Beiträge
 
Delphi 7 Enterprise
 
#3

Re: ScrollBox ohne Wheel funktion ?

  Alt 19. Okt 2003, 19:22
Hallo Tau,

vielleicht hilft Dir, was Peter Below in einer NG (borland.public.delphi.vcl.components.using)
geschrieben hat:


Zitat:
...
No, nothing at all special, i only set the images Autosize property to true to
make it adjust to the image size. This may in fact be a mouse driver problem.
Most wheel mouse drivers have a compatibility option that makes them send
normal scroll messages (not WM_MOUSEWHEEL messages) to a control if it has the
WS_VSCROLL style when the user operates the wheel. This works even with
controls that are not "wheel-aware".

Ah, yes. My mouse driver has a checkbox to activate MS Intellimouse
compatibility, if i check that the scrolling no longer works, so the mouse is
working in a somewhat smarter mode normally. The main problem seems to be that
the scrollbox does not take focus when clicked on, and the MS Intellimouse
driver will only send WM_MOUSEWHEEL messages to the control with focus.
So the
messages go to the form. The default handling in the VCL will only forward
them to the control with focus either, so no joy here as well.

You can use the forms OnMouseWheel event to fix this behaviour:

procedure TForm1.FormMouseWheel(Sender: TObject; Shift: TShiftState;
WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean);
Var
msg: Cardinal;
code: Cardinal;
i, n: Integer;
begin
If WindowFromPoint( mousepos ) = scrollbox1.Handle Then Begin
Handled := true;
If ssShift In Shift Then
msg := WM_HSCROLL
Else
msg := WM_VSCROLL;

If WheelDelta < 0 Then
code := SB_LINEUP
Else
code := SB_LINEDOWN;

n:= Mouse.WheelScrollLines;
For i:= 1 to n Do
scrollbox1.Perform( msg, code, 0 );
scrollbox1.Perform( msg, SB_ENDSCROLL, 0 );
End;
end;
Armin P. Pressler

BEGIN
...real programmers are using C/C++ - smart developers Delphi;
END;
  Mit Zitat antworten Zitat