Bonjour développeurs,
J'utilise Windows 7, Lazarus version 1.0.12, FPC 2.6.2 et SVN 42478.
Je viens de constater une situation qui me semble être une anomalie avec le ScrollBar.
La position que je donne au ScrollBar ne correspond pas tout à fait à la position que devrait être la ScrollBar.
Voir la capture d'écran ci-joint.
Voici le code que vous pouvez tester afin de confirmer que cette situation peut être répétée.
Le TrackBar lui se positionne à la bonne place alors que la position du ScrollBar n'est pas du tout à la bonne position.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73 unit Unit1; {$mode objfpc}{$H+} interface uses Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, ComCtrls; type { TForm1 } TForm1 = class(TForm) Label1: TLabel; Label10: TLabel; Label11: TLabel; Label12: TLabel; Label13: TLabel; Label14: TLabel; Label15: TLabel; Label16: TLabel; Label17: TLabel; Label18: TLabel; Label2: TLabel; Label3: TLabel; Label4: TLabel; Label5: TLabel; Label6: TLabel; Label7: TLabel; Label8: TLabel; Label9: TLabel; ScrollBar1: TScrollBar; ScrollBar2: TScrollBar; ScrollBar3: TScrollBar; TrackBar1: TTrackBar; procedure FormCreate(Sender: TObject); private { private declarations } public { public declarations } end; var Form1: TForm1; iPos : byte; implementation {$R *.lfm} { TForm1 } procedure TForm1.FormCreate(Sender: TObject); begin iPos := 2; ScrollBar1.Position := iPos; Label1.Caption := intTostr(ScrollBar1.Position); ScrollBar2.Position := iPos; Label5.Caption := intTostr(ScrollBar2.Position); ScrollBar3.Position := iPos; Label18.Caption := intTostr(ScrollBar3.Position); TrackBar1.Position := iPos; Label6.Caption := intTostr(TrackBar1.Position); end; end.
Est-ce un bug ou c'est la façon dont se comporte le ScrollBar???
Partager