martbase
asked on
PageScroller Button Panel
Hi!
I am developing a program which creates buttons (TBitBtn) dynamically and uses a PageScroller as the display panel. My problem is that the PageScroller doesn't display its scroll buttons even when the number of buttons exceeds the display area. I have tried putting a PageControl, ScrollBox, then a Panel on the PageScroller and setting the Parent property of the buttons to the PageControl/ScrollBox/Pane l; tried using the PageScroller by itself and setting the Parent property of the buttons to the PageScroller, but still I haven’t achieved the result I want. I really want to use the PageScroller as my button panel and I believe if it is possible in Delphi (Component palette) then I could do the same. I will appreciate any ideas, examples or articles that could enable me use the PageScroller to display my buttons and be able to scroll to those not visible on the screen.
Thank you,
Martin
I am developing a program which creates buttons (TBitBtn) dynamically and uses a PageScroller as the display panel. My problem is that the PageScroller doesn't display its scroll buttons even when the number of buttons exceeds the display area. I have tried putting a PageControl, ScrollBox, then a Panel on the PageScroller and setting the Parent property of the buttons to the PageControl/ScrollBox/Pane
Thank you,
Martin
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Also take a look at thei free component:
http://www.torry.net/vcl/panels/enhancedpanels/scpanel.zip
and other panel components you can find on torry.net. They are quite usefull sometimes.
:-)
http://www.torry.net/vcl/panels/enhancedpanels/scpanel.zip
and other panel components you can find on torry.net. They are quite usefull sometimes.
:-)
If you really want it to look like the delphi component pallette just use the following code:
//dfm
object Form1: TForm1
Left = 192
Top = 107
Width = 979
Height = 307
Caption = 'Form1'
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = False
PixelsPerInch = 96
TextHeight = 13
object ScrollBox2: TScrollBox
Left = 0
Top = 0
Width = 971
Height = 57
HorzScrollBar.ButtonSize = 10
HorzScrollBar.Margin = 5
HorzScrollBar.Smooth = True
HorzScrollBar.Size = 10
HorzScrollBar.Style = ssHotTrack
HorzScrollBar.Tracking = True
HorzScrollBar.Visible = False
VertScrollBar.Smooth = True
VertScrollBar.Style = ssFlat
VertScrollBar.Visible = False
Align = alTop
BevelInner = bvNone
BevelOuter = bvNone
BorderStyle = bsNone
Ctl3D = False
ParentBackground = True
ParentCtl3D = False
TabOrder = 0
end
object Button1: TButton
Left = 0
Top = 64
Width = 117
Height = 25
Caption = 'Generate buttons'
TabOrder = 1
OnClick = Button1Click
end
object UpDown1: TUpDown
Left = 934
Top = -1
Width = 37
Height = 16
Orientation = udHorizontal
TabOrder = 2
OnClick = UpDown1Click
end
end
//dfm
object Form1: TForm1
Left = 192
Top = 107
Width = 979
Height = 307
Caption = 'Form1'
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = False
PixelsPerInch = 96
TextHeight = 13
object ScrollBox2: TScrollBox
Left = 0
Top = 0
Width = 971
Height = 57
HorzScrollBar.ButtonSize = 10
HorzScrollBar.Margin = 5
HorzScrollBar.Smooth = True
HorzScrollBar.Size = 10
HorzScrollBar.Style = ssHotTrack
HorzScrollBar.Tracking = True
HorzScrollBar.Visible = False
VertScrollBar.Smooth = True
VertScrollBar.Style = ssFlat
VertScrollBar.Visible = False
Align = alTop
BevelInner = bvNone
BevelOuter = bvNone
BorderStyle = bsNone
Ctl3D = False
ParentBackground = True
ParentCtl3D = False
TabOrder = 0
end
object Button1: TButton
Left = 0
Top = 64
Width = 117
Height = 25
Caption = 'Generate buttons'
TabOrder = 1
OnClick = Button1Click
end
object UpDown1: TUpDown
Left = 934
Top = -1
Width = 37
Height = 16
Orientation = udHorizontal
TabOrder = 2
OnClick = UpDown1Click
end
end
And the PAS code:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons, jpeg, ExtCtrls, ComCtrls;
type
TForm1 = class(TForm)
ScrollBox2: TScrollBox;
Button1: TButton;
UpDown1: TUpDown;
procedure Button1Click(Sender: TObject);
procedure UpDown1Click(Sender: TObject; Button: TUDBtnType);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender : TObject);
var
bt:TBitBtn;
i,j:Integer;
begin
j:=10;
for i:=1 to 20 do
begin
bt:=TBitBtn.Create(Self);
bt.Parent:=ScrollBox2;
bt.Name:='but'+IntToStr(i) ;
bt.Caption:=bt.Name;
bt.Height:=22;
bt.Width:=80;
bt.top:=15;
bt.Left:=j;
j:=j+90;
end;
end;
procedure TForm1.UpDown1Click(Sender : TObject; Button: TUDBtnType);
begin
If Button=btNext then ScrollBox2.ScrollBy(-15,0)
else
If Button=btPrev then ScrollBox2.ScrollBy(15,0);
end;
end.
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons, jpeg, ExtCtrls, ComCtrls;
type
TForm1 = class(TForm)
ScrollBox2: TScrollBox;
Button1: TButton;
UpDown1: TUpDown;
procedure Button1Click(Sender: TObject);
procedure UpDown1Click(Sender: TObject; Button: TUDBtnType);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender
var
bt:TBitBtn;
i,j:Integer;
begin
j:=10;
for i:=1 to 20 do
begin
bt:=TBitBtn.Create(Self);
bt.Parent:=ScrollBox2;
bt.Name:='but'+IntToStr(i)
bt.Caption:=bt.Name;
bt.Height:=22;
bt.Width:=80;
bt.top:=15;
bt.Left:=j;
j:=j+90;
end;
end;
procedure TForm1.UpDown1Click(Sender
begin
If Button=btNext then ScrollBox2.ScrollBy(-15,0)
else
If Button=btPrev then ScrollBox2.ScrollBy(15,0);
end;
end.
I assume you are still working on the code I gave you for the previous question... so :
- the upDown component should be parented by the tabsheet
- on the tabsheet you should place the scrollbox
- alClient the scrollbox (to align it to the tabsheet)
Of course Make Visible=false for the ScrollBox's VertScrollBar and HorzScrollBar properties, make it flat ( ctl3d=false, borderstyle=none, and no bevels)
It should be done
regards
- the upDown component should be parented by the tabsheet
- on the tabsheet you should place the scrollbox
- alClient the scrollbox (to align it to the tabsheet)
Of course Make Visible=false for the ScrollBox's VertScrollBar and HorzScrollBar properties, make it flat ( ctl3d=false, borderstyle=none, and no bevels)
It should be done
regards
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Well... dear martbase does my code work or do I waste my time answering your questions...?
ASKER
Hi,
The code works but none uses the PageScroller. Maybe am the one who is wrong here but what component was used on the Delphi component palette. I like the way the scroll arrows appear when there are more buttons than can fit on a line.
The code works but none uses the PageScroller. Maybe am the one who is wrong here but what component was used on the Delphi component palette. I like the way the scroll arrows appear when there are more buttons than can fit on a line.
Are you sure that you have tested the code? Or do you need the full working code again?
The above code does not use the pagescroller but it creates a behaviour just like the component pallete from Delphi. Except for the pagescroller thing... that cxan also be simulated in the ScrollBox. As you can read in the delphi help :
"...The page scroller control is similar to the scroll box control. However, the page scroller provides arrows that extend over the edges of the display area, whereas the scroll box provides scroll bars. Also, the page scroller supports scrolling for only one orientation (horizontal or vertical), so the constrained window must fit either the width or height of the display area."
So you can simulate it's behaviour just by adding a SpeedButton (with some special character on it or even a glyph that will look like the arrow of the PageScroller and use the same events like above I explained for the UpDown Buttons. You don't HAVE to use the updown buttons you can use whatever you like.
There is no component on the delphi pallete that is exactly like the component pallete. Borland created the component for themselves and did not share it with us. So all you can do is improvise it's look and behaviour, like I have shown you above.
Regards
The above code does not use the pagescroller but it creates a behaviour just like the component pallete from Delphi. Except for the pagescroller thing... that cxan also be simulated in the ScrollBox. As you can read in the delphi help :
"...The page scroller control is similar to the scroll box control. However, the page scroller provides arrows that extend over the edges of the display area, whereas the scroll box provides scroll bars. Also, the page scroller supports scrolling for only one orientation (horizontal or vertical), so the constrained window must fit either the width or height of the display area."
So you can simulate it's behaviour just by adding a SpeedButton (with some special character on it or even a glyph that will look like the arrow of the PageScroller and use the same events like above I explained for the UpDown Buttons. You don't HAVE to use the updown buttons you can use whatever you like.
There is no component on the delphi pallete that is exactly like the component pallete. Borland created the component for themselves and did not share it with us. So all you can do is improvise it's look and behaviour, like I have shown you above.
Regards
I am sure a button like this will do just fine for simulating the appearance of the PageScroller button:
object SpeedButton4: TSpeedButton
Left = 838
Top = 0
Width = 14
Height = 35
Anchors = [akTop, akRight]
Flat = True
Glyph.Data = {
B6010000424DB6010000000000 0036000000 280000000A 0000000C00 00000100
18000000000080010000000000 0000000000 0000000000 000000FFFF FFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFFFF FFFFFFFFFF FF0000FFFF FFFFFFFF
FFFFFFFFFFFF000000FFFFFFFF FFFFFFFFFF FFFFFFFFFF FF0000FFFF FFFFFFFF
FFFFFFFFFFFF000000000000FF FFFFFFFFFF FFFFFFFFFF FF0000FFFF FFFFFFFF
FFFFFFFFFFFF000000000000FF FFFFFFFFFF FFFFFFFFFF FF0000FFFF FFFFFFFF
FFFFFFFFFFFF00000000000000 0000FFFFFF FFFFFFFFFF FF0000FFFF FFFFFFFF
FFFFFFFFFFFF00000000000000 0000000000 FFFFFFFFFF FF0000FFFF FFFFFFFF
FFFFFFFFFFFF00000000000000 0000FFFFFF FFFFFFFFFF FF0000FFFF FFFFFFFF
FFFFFFFFFFFF000000000000FF FFFFFFFFFF FFFFFFFFFF FF0000FFFF FFFFFFFF
FFFFFFFFFFFF000000000000FF FFFFFFFFFF FFFFFFFFFF FF0000FFFF FFFFFFFF
FFFFFFFFFFFF000000FFFFFFFF FFFFFFFFFF FFFFFFFFFF FF0000FFFF FFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFFFF FFFFFFFFFF FF0000FFFF FFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFFFF FFFFFFFFFF FF0000}
OnClick = SpeedButton4Click
end
object SpeedButton4: TSpeedButton
Left = 838
Top = 0
Width = 14
Height = 35
Anchors = [akTop, akRight]
Flat = True
Glyph.Data = {
B6010000424DB6010000000000
18000000000080010000000000
FFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFF000000FFFFFFFF
FFFFFFFFFFFF000000000000FF
FFFFFFFFFFFF000000000000FF
FFFFFFFFFFFF00000000000000
FFFFFFFFFFFF00000000000000
FFFFFFFFFFFF00000000000000
FFFFFFFFFFFF000000000000FF
FFFFFFFFFFFF000000000000FF
FFFFFFFFFFFF000000FFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFF
OnClick = SpeedButton4Click
end
Now...
You must do the following:
in the PageControl... in the tab where the button (for adding shortcuts) is...you must set the scrollbox to have align = alNone. You then must shrink it's width a little just enough to allow placing a slim button in front of it and at the end of it. Then with Anchors you must anchor scrollbox to left and right side of the TabSheet.
Then place the slim speedbuttons on the TAB (not on the scrollbox). Set the right speedbutton to anchor to the right instead of left.
And after that just add events to the speedbuttons, such as:
For the speed button in the right side of the screen add this code
ScrollBox2.ScrollBy(-15,0)
For the speed button in the left side of the screen add this code
ScrollBox2.ScrollBy(15,0);
And that's all.
I repeat : there is no such component out there that is only one and does all that the component pallete does, so you have to improvize.
Regards
You must do the following:
in the PageControl... in the tab where the button (for adding shortcuts) is...you must set the scrollbox to have align = alNone. You then must shrink it's width a little just enough to allow placing a slim button in front of it and at the end of it. Then with Anchors you must anchor scrollbox to left and right side of the TabSheet.
Then place the slim speedbuttons on the TAB (not on the scrollbox). Set the right speedbutton to anchor to the right instead of left.
And after that just add events to the speedbuttons, such as:
For the speed button in the right side of the screen add this code
ScrollBox2.ScrollBy(-15,0)
For the speed button in the left side of the screen add this code
ScrollBox2.ScrollBy(15,0);
And that's all.
I repeat : there is no such component out there that is only one and does all that the component pallete does, so you have to improvize.
Regards
To only scroll when controls are on the scrollbox and only if thewy are too many to fit use this code in the right speedbuttonclick:
var i, max : Integer;
begin
if scrollbox1.ControlCount > 0 then // only if controls available
begin
max := scrollbox1.Controls[0].Lef t + scrollbox1.Controls[0].Wid th;
For I := 0 to scrollbox1.ControlCount - 1 do
if scrollbox1.Controls[I].Lef t + scrollbox1.Controls[I].Wid th > max then
begin
max := scrollbox1.Controls[I].Lef t + scrollbox1.Controls[I].Wid th;
end;
if max > ScrollBox1.ClientWidth then
begin
ScrollBox1.ScrollBy(-10,0) ;
end;
end;
end;
var i, max : Integer;
begin
if scrollbox1.ControlCount > 0 then // only if controls available
begin
max := scrollbox1.Controls[0].Lef
For I := 0 to scrollbox1.ControlCount - 1 do
if scrollbox1.Controls[I].Lef
begin
max := scrollbox1.Controls[I].Lef
end;
if max > ScrollBox1.ClientWidth then
begin
ScrollBox1.ScrollBy(-10,0)
end;
end;
end;
Here is some code to show you how (it needs somt tunning but it works just fine doing what you expect it to do:
dfm file:
object Form1: TForm1
Left = 192
Top = 107
BorderStyle = bsNone
Caption = 'Shortcuts TAB'
ClientHeight = 66
ClientWidth = 862
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = False
OnClose = FormClose
OnShow = FormShow
PixelsPerInch = 96
TextHeight = 13
object Image1: TImage
Left = 8
Top = 60
Width = 21
Height = 21
Transparent = True
Visible = False
end
object Image2: TImage
Left = 8
Top = 108
Width = 29
Height = 25
Picture.Data = {
07544269746D6170F606000042 4DF6060000 0000000036 0000002800 00001800
00001800000001001800000000 00C0060000 120B000012 0B00000000 00000000
0000FF00FF0481BF0082C10082 C1FF00FFFF 00FFFF00FF FF00FFFF00 FFFF00FF
FF00FFFF00FFFF00FFFF00FFFF 00FFFF00FF FF00FFFF00 FFFF00FFFF 00FFFF00
FFFF00FFFF00FFFF00FF0082C1 69BBDE75D0 F329A3DD00 82C10082C1 0082C100
82C10082C1FF00FFFF00FFFF00 FFFF00FFFF 00FFFF00FF FF00FFFF00 FFFF00FF
FF00FFFF00FFFF00FFFF00FFFF 00FFFF00FF 0082C1219A CEB1E7FB56 CBFA5DCC
FA5CCBF854C5F333ABE228A3D9 0082C10082 C10082C100 82C10082C1 FF00FFFF
00FFFF00FFFF00FFFF00FFFF00 FFFF00FFFF 00FFFF00FF FF00FF0082 C10386C2
9AD8ED66CFF855C7F658C7F659 CAF65CCBF7 5ECEFA5ECC FA59C7F64E C0EF2DA6
DD229CD50082C10082C10082C1 0082C1FF00 FFFF00FFFF 00FFFF00FF FF00FFFF
00FF0082C124ADE134A5D397E1 FB52C6F657 C7F657C7F6 57C7F657C7 F658C7F6
58C9F65CCBF75ECCFA5FCEFA5D CBF858C9F4 35ADE32CA5 DC0082C1FF 00FFFF00
FFFF00FFFF00FFFF00FF0082C1 44C6F30C8C C6BCEBFA57 CBF75ACBF6 5ACBF65A
CBF65ACBF65ACBF65ACBF65ACB F65ACBF65B CBF65BCBF6 5DCEF662CF F844BBED
5AC7F20082C1FF00FFFF00FFFF 00FFFF00FF 0082C149CC F70082C18B D3EB7EDC
FB5DD0F660D0F660D0F660D0F6 60D0F660D0 F660D0F660 D0F660D0F6 5FD0F65F
D0F760D1F741BAE968D4F80082 C1FF00FFFF 00FFFF00FF FF00FF0082 C14BCEF8
2AA4D71C97CCADEDFC60D3F666 D5F666D5F6 66D5F666D5 F666D5F666 D5F666D5
F666D5F666D5F666D7F767D7F7 44BDE777E1 FA51C2E900 82C1FF00FF FF00FFFF
00FF0082C14DCFFC44B1E10284 C2C2F0FB6E DDF86ADAF7 6BDCF76BDC F76BDCF7
6BDCF76ADCF76ADCF76ADCF76A DCF76BDCF7 6BDDF848C2 E77AE5FA6D DAF40082
C1FF00FFFF00FFFF00FF0082C1 4FD3FF48B4 E60082C179 CCE79EEFFC 6AE0F76D
E0F76DE0F76EE0F76EE0F76FE1 F76FE1F76F E1F76FE1F7 6FE2F770E2 F84DC7E9
7DE7FA81EDFB0082C1FF00FFFF 00FFFF00FF 0082C157D5 FF4CB7EB2C A6DC088A
C5C9F6FC7FEBFB7DEAFA7DEAFA 79EAFA76E7 F873E5F874 E6F874E6F8 74E6F875
E6F876E7F852CEE981EEF88AF4 FC68D9EE00 82C1FF00FF FF00FF0082 C175DDFF
4FBAEF49B5EB0082C1ADE0F0C0 EDF7BDEEF7 C1F0F8C2F3 FA8EEEF884 EFFA7BEB
F87DEAF87DEBF87DEBF87EEDFA 59D3E989F3 FA8FF7FB89 F2FA0082C1 FF00FFFF
00FF0082C193E5FF52BDF44FBA F24DB6EF36 A7E10082C1 0082C10082 C10082C1
7BCBE7BAF0F8A6F6FC95EFFA91 EEF892EEF8 95EFFA6ED5 E9A5F6FAA4 F6FAB1FE
FE0082C1FF00FFFF00FF0082C1 A6EFFF5AC6 F456C2F256 C2F356C1F2 53BFF054
BFF054C0F031AAE00284C22EA3 D1CAEFF7CA F7FCBDF4FE B6F3FBB5F3 FB8BD8EB
C9FAFBC7FAFAD8FFFEA5E7F200 82C1FF00FF 0082C1A7F0 FF63CFF65E CBF35ECB
F35ECBF35ECBF25ECBF25ECBF2 5DCBF25CC9 F232ACE009 8BC687CFE7 D3F2F8CC
F4FBC9F4FCA3DDEDF2FFFFF0FF FEFAFFFFF6 FFFF0082C1 FF00FF0082 C1B2F6FF
6AD8F666D4F366D4F366D4F366 D4F366D4F3 66D4F366D4 F366D4F365 D3F33CB7
E30082C11693CA86CEE9B0E1F0 97D1E7CEEA F4CFEAF3D4 EDF4E0F0F7 0082C1FF
00FF0082C1B4F8FF72E0F76DDC F46DDCF46D DCF46DDCF4 6DDCF66DDC F46BDCF4
6BDCF46CDCF46CDAF469D8F335 B1DC0082C1 0082C10082 C10082C100 82C10082
C10082C10082C1FF00FF0082C1 CAFFFF76E7 F876E3F776 E3F776E3F7 76E3F775
E3F679E7F87EEBFB7BEBFA7AEA FA79E9F877 E9F876E6F8 77E7F780EE FB0082C1
FF00FFFF00FFFF00FFFF00FFFF 00FFFF00FF 0082C1D8FE FF95F7FC75 EAF77AED
F77AEDF77AEDF77DEDF789EBF6 9FE7F4A0EB F6A3EDF7A5 EFF7A4F0F8 9DF0FA96
F0FB95F8FF0082C1FF00FFFF00 FFFF00FFFF 00FFFF00FF FF00FFFF00 FF0082C1
D0FFFF8EFAFC89F8FB86F6FA84 F6FB83F3F8 5CC4E00082 C10082C100 82C10082
C10082C10082C10082C10082C1 0082C1FF00 FFFF00FFFF 00FFFF00FF FF00FFFF
00FFFF00FFFF00FF0082C1AAEA F3A6EBF3AA EEF6B1F7FA 9DEAF30082 C1FF00FF
FF00FFFF00FFFF00FFFF00FFFF 00FFFF00FF FF00FFFF00 FFFF00FFFF 00FFFF00
FFFF00FFFF00FFFF00FFFF00FF FF00FFFF00 FF0082C100 82C10082C1 0082C100
82C1FF00FFFF00FFFF00FFFF00 FFFF00FFFF 00FFFF00FF FF00FFFF00 FFFF00FF
FF00FFFF00FFFF00FFFF00FFFF 00FFFF00FF FF00FFFF00 FFFF00FFFF 00FFFF00
FFFF00FFFF00FFFF00FFFF00FF FF00FFFF00 FFFF00FFFF 00FFFF00FF FF00FFFF
00FFFF00FFFF00FFFF00FFFF00 FFFF00FFFF 00FFFF00FF FF00FFFF00 FFFF00FF
FF00FFFF00FFFF00FFFF00FFFF 00FFFF00FF FF00FFFF00 FFFF00FFFF 00FFFF00
FFFF00FFFF00FFFF00FFFF00FF FF00FFFF00 FFFF00FFFF 00FFFF00FF FF00FFFF
00FF}
Visible = False
end
object Panel1: TPanel
Left = 0
Top = 0
Width = 862
Height = 66
Align = alClient
TabOrder = 0
object PageControl1: TPageControl
Left = 1
Top = 1
Width = 860
Height = 64
ActivePage = TabSheet1
Align = alClient
PopupMenu = PopupMenu1
TabOrder = 0
object TabSheet1: TTabSheet
Caption = 'File shortcuts'
DesignSize = (
852
36)
object Label1: TLabel
Left = 4
Top = 12
Width = 6
Height = 13
Caption = '1'
Visible = False
end
object SpeedButton3: TSpeedButton
Left = 2
Top = 0
Width = 11
Height = 35
Caption = '<'
OnClick = SpeedButton3Click
end
object SpeedButton4: TSpeedButton
Left = 838
Top = 0
Width = 14
Height = 35
Anchors = [akTop, akRight]
Flat = True
Glyph.Data = {
B6010000424DB6010000000000 0036000000 280000000A 0000000C00 00000100
18000000000080010000000000 0000000000 0000000000 000000FFFF FFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFFFF FFFFFFFFFF FF0000FFFF FFFFFFFF
FFFFFFFFFFFF000000FFFFFFFF FFFFFFFFFF FFFFFFFFFF FF0000FFFF FFFFFFFF
FFFFFFFFFFFF000000000000FF FFFFFFFFFF FFFFFFFFFF FF0000FFFF FFFFFFFF
FFFFFFFFFFFF000000000000FF FFFFFFFFFF FFFFFFFFFF FF0000FFFF FFFFFFFF
FFFFFFFFFFFF00000000000000 0000FFFFFF FFFFFFFFFF FF0000FFFF FFFFFFFF
FFFFFFFFFFFF00000000000000 0000000000 FFFFFFFFFF FF0000FFFF FFFFFFFF
FFFFFFFFFFFF00000000000000 0000FFFFFF FFFFFFFFFF FF0000FFFF FFFFFFFF
FFFFFFFFFFFF000000000000FF FFFFFFFFFF FFFFFFFFFF FF0000FFFF FFFFFFFF
FFFFFFFFFFFF000000000000FF FFFFFFFFFF FFFFFFFFFF FF0000FFFF FFFFFFFF
FFFFFFFFFFFF000000FFFFFFFF FFFFFFFFFF FFFFFFFFFF FF0000FFFF FFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFFFF FFFFFFFFFF FF0000FFFF FFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFFFF FFFFFFFFFF FF0000}
OnClick = SpeedButton4Click
OnMouseDown = SpeedButton4MouseDown
OnMouseUp = SpeedButton4MouseUp
end
object ScrollBox1: TScrollBox
Left = 14
Top = 0
Width = 824
Height = 35
HorzScrollBar.Visible = False
VertScrollBar.Visible = False
Anchors = [akLeft, akTop, akRight]
BevelInner = bvNone
BevelOuter = bvNone
BorderStyle = bsNone
Ctl3D = False
ParentCtl3D = False
TabOrder = 0
object SpeedButton1: TSpeedButton
Left = 16
Top = 1
Width = 30
Height = 27
Hint = 'Add new shortcut'
Flat = True
Glyph.Data = {
36030000424D36030000000000 0036000000 2800000010 0000001000 00000100
18000000000000030000120B00 00120B0000 0000000000 000000FF00 FFFF00FF
FF00FFFF00FFFF00FF8E5D598E 5D598E5D59 8E5D598E5D 598E5D598E 5D598E5D
598E5D59734241FF00FFFF00FF FF00FFFF00 FFFF00FFFF 00FF92625A FEDDBCFF
D9B4FFD5ACFFD1A5FFCE9DFECA 97FFC790FF C48B734241 FF00FFFF00 FFFF00FF
FF00FFFF00FFFF00FF98665DFF E3C7DD903D DD903DDD90 3DDD903DDD 903DDD90
3DFFC792734241FF00FFFF00FF FF00FFFF00 FFFF00FFFF 00FFA06C5F FEE9D3FF
E5CAFFE1C1FFDCBAFED8B1FED3 A9FFD0A1FF CC9A734241 FF00FF8E5D 598E5D59
8E5D598E5D598E5D59A77463FE EEDDDD903D DD903DDD90 3DDD903DDD 903DDD90
3DFED1A4734241FF00FF92625A FEDDBCFFD9 B4FFD5ACFF D1A5B17D67 FEF3E6FE
EFDEFEEAD8FFE7CFFEE2C7FEDE BDFFD9B6FE D5AD734241 FF00FF9866 5DFFE3C7
DD903DDD903DDD903DBB8369FF F7EFDD903D DD903DDD90 3DDD903DDD 903DDD90
3DFEDAB8734241FF00FFA06C5F FEE9D3FFE5 CAFFE1C1FF DCBAC48B6C FEFAF7FE
F7F0FEF4EAFEF2E3FEEDDCFEE9 D4FEE5CBFE E1C2734241 FF00FFA774 63FEEEDD
DD903DDD903DDD903DCC9370FE FEFCFEFBF8 FEF8F3FEF6 EDFEF2E6E5 D5D0C6B1
AFA79395734241FF00FFB17D67 FEF3E6FEEF DEFEEAD8FF E7CFD59C74 FEFEFEFE
FEFEFEFBFAFEFAF4FEF6EEA067 5BA0675BA0 675B9D6559 FF00FFBB83 69FFF7EF
DD903DDD903DDD903DDCA175FE FEFEFEFEFE FEFEFEFEFC FBFEFAF6A0 675BE5A1
54DC832AFF00FFFF00FFC48B6C FEFAF7FEF7 F0FEF4EAFE F2E3E1A577 D1926DD1
926DD1926DD1926DD1926DA067 5BEB9E43FF 00FFFF00FF FF00FFCC93 70FEFEFC
FEFBF8FEF8F3FEF6EDFEF2E6E5 D5D0C6B1AF A793957342 41FF00FFFF 00FFFF00
FFFF00FFFF00FFFF00FFD59C74 FEFEFEFEFE FEFEFBFAFE FAF4FEF6EE A0675BA0
675BA0675B9D6559FF00FFFF00 FFFF00FFFF 00FFFF00FF FF00FFDCA1 75FEFEFE
FEFEFEFEFEFEFEFCFBFEFAF6A0 675BE5A154 DC832AFF00 FFFF00FFFF 00FFFF00
FFFF00FFFF00FFFF00FFE1A577 D1926DD192 6DD1926DD1 926DD1926D A0675BEB
9E43FF00FFFF00FFFF00FFFF00 FFFF00FFFF 00FFFF00FF FF00FF}
ParentShowHint = False
ShowHint = True
OnClick = SpeedButton1Click
end
end
end
end
end
object OpenDialog1: TOpenDialog
Left = 128
Top = 24
end
object PopupMenu1: TPopupMenu
Left = 684
Top = 4
object CloseTAB1: TMenuItem
Caption = 'Close TAB'
OnClick = CloseTAB1Click
end
end
object Timer1: TTimer
Enabled = False
Interval = 500
OnTimer = Timer1Timer
Left = 296
Top = 24
end
end
dfm file:
object Form1: TForm1
Left = 192
Top = 107
BorderStyle = bsNone
Caption = 'Shortcuts TAB'
ClientHeight = 66
ClientWidth = 862
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = False
OnClose = FormClose
OnShow = FormShow
PixelsPerInch = 96
TextHeight = 13
object Image1: TImage
Left = 8
Top = 60
Width = 21
Height = 21
Transparent = True
Visible = False
end
object Image2: TImage
Left = 8
Top = 108
Width = 29
Height = 25
Picture.Data = {
07544269746D6170F606000042
00001800000001001800000000
0000FF00FF0481BF0082C10082
FF00FFFF00FFFF00FFFF00FFFF
FFFF00FFFF00FFFF00FF0082C1
82C10082C1FF00FFFF00FFFF00
FF00FFFF00FFFF00FFFF00FFFF
FA5CCBF854C5F333ABE228A3D9
00FFFF00FFFF00FFFF00FFFF00
9AD8ED66CFF855C7F658C7F659
DD229CD50082C10082C10082C1
00FF0082C124ADE134A5D397E1
58C9F65CCBF75ECCFA5FCEFA5D
FFFF00FFFF00FFFF00FF0082C1
CBF65ACBF65ACBF65ACBF65ACB
5AC7F20082C1FF00FFFF00FFFF
FB5DD0F660D0F660D0F660D0F6
D0F760D1F741BAE968D4F80082
2AA4D71C97CCADEDFC60D3F666
F666D5F666D5F666D7F767D7F7
00FF0082C14DCFFC44B1E10284
6BDCF76ADCF76ADCF76ADCF76A
C1FF00FFFF00FFFF00FF0082C1
E0F76DE0F76EE0F76EE0F76FE1
7DE7FA81EDFB0082C1FF00FFFF
C5C9F6FC7FEBFB7DEAFA7DEAFA
E6F876E7F852CEE981EEF88AF4
4FBAEF49B5EB0082C1ADE0F0C0
F87DEAF87DEBF87DEBF87EEDFA
00FF0082C193E5FF52BDF44FBA
7BCBE7BAF0F8A6F6FC95EFFA91
FE0082C1FF00FFFF00FF0082C1
BFF054C0F031AAE00284C22EA3
C9FAFBC7FAFAD8FFFEA5E7F200
F35ECBF35ECBF25ECBF25ECBF2
F4FBC9F4FCA3DDEDF2FFFFF0FF
6AD8F666D4F366D4F366D4F366
E30082C11693CA86CEE9B0E1F0
00FF0082C1B4F8FF72E0F76DDC
6BDCF46CDCF46CDAF469D8F335
C10082C10082C1FF00FF0082C1
E3F679E7F87EEBFB7BEBFA7AEA
FF00FFFF00FFFF00FFFF00FFFF
F77AEDF77AEDF77DEDF789EBF6
F0FB95F8FF0082C1FF00FFFF00
D0FFFF8EFAFC89F8FB86F6FA84
C10082C10082C10082C10082C1
00FFFF00FFFF00FF0082C1AAEA
FF00FFFF00FFFF00FFFF00FFFF
FFFF00FFFF00FFFF00FFFF00FF
82C1FF00FFFF00FFFF00FFFF00
FF00FFFF00FFFF00FFFF00FFFF
FFFF00FFFF00FFFF00FFFF00FF
00FFFF00FFFF00FFFF00FFFF00
FF00FFFF00FFFF00FFFF00FFFF
FFFF00FFFF00FFFF00FFFF00FF
00FF}
Visible = False
end
object Panel1: TPanel
Left = 0
Top = 0
Width = 862
Height = 66
Align = alClient
TabOrder = 0
object PageControl1: TPageControl
Left = 1
Top = 1
Width = 860
Height = 64
ActivePage = TabSheet1
Align = alClient
PopupMenu = PopupMenu1
TabOrder = 0
object TabSheet1: TTabSheet
Caption = 'File shortcuts'
DesignSize = (
852
36)
object Label1: TLabel
Left = 4
Top = 12
Width = 6
Height = 13
Caption = '1'
Visible = False
end
object SpeedButton3: TSpeedButton
Left = 2
Top = 0
Width = 11
Height = 35
Caption = '<'
OnClick = SpeedButton3Click
end
object SpeedButton4: TSpeedButton
Left = 838
Top = 0
Width = 14
Height = 35
Anchors = [akTop, akRight]
Flat = True
Glyph.Data = {
B6010000424DB6010000000000
18000000000080010000000000
FFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFF000000FFFFFFFF
FFFFFFFFFFFF000000000000FF
FFFFFFFFFFFF000000000000FF
FFFFFFFFFFFF00000000000000
FFFFFFFFFFFF00000000000000
FFFFFFFFFFFF00000000000000
FFFFFFFFFFFF000000000000FF
FFFFFFFFFFFF000000000000FF
FFFFFFFFFFFF000000FFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFF
OnClick = SpeedButton4Click
OnMouseDown = SpeedButton4MouseDown
OnMouseUp = SpeedButton4MouseUp
end
object ScrollBox1: TScrollBox
Left = 14
Top = 0
Width = 824
Height = 35
HorzScrollBar.Visible = False
VertScrollBar.Visible = False
Anchors = [akLeft, akTop, akRight]
BevelInner = bvNone
BevelOuter = bvNone
BorderStyle = bsNone
Ctl3D = False
ParentCtl3D = False
TabOrder = 0
object SpeedButton1: TSpeedButton
Left = 16
Top = 1
Width = 30
Height = 27
Hint = 'Add new shortcut'
Flat = True
Glyph.Data = {
36030000424D36030000000000
18000000000000030000120B00
FF00FFFF00FFFF00FF8E5D598E
598E5D59734241FF00FFFF00FF
D9B4FFD5ACFFD1A5FFCE9DFECA
FF00FFFF00FFFF00FF98665DFF
3DFFC792734241FF00FFFF00FF
E5CAFFE1C1FFDCBAFED8B1FED3
8E5D598E5D598E5D59A77463FE
3DFED1A4734241FF00FF92625A
EFDEFEEAD8FFE7CFFEE2C7FEDE
DD903DDD903DDD903DBB8369FF
3DFEDAB8734241FF00FFA06C5F
F7F0FEF4EAFEF2E3FEEDDCFEE9
DD903DDD903DDD903DCC9370FE
AFA79395734241FF00FFB17D67
FEFEFEFBFAFEFAF4FEF6EEA067
DD903DDD903DDD903DDCA175FE
54DC832AFF00FFFF00FFC48B6C
926DD1926DD1926DD1926DA067
FEFBF8FEF8F3FEF6EDFEF2E6E5
FFFF00FFFF00FFFF00FFD59C74
675BA0675B9D6559FF00FFFF00
FEFEFEFEFEFEFEFCFBFEFAF6A0
FFFF00FFFF00FFFF00FFE1A577
9E43FF00FFFF00FFFF00FFFF00
ParentShowHint = False
ShowHint = True
OnClick = SpeedButton1Click
end
end
end
end
end
object OpenDialog1: TOpenDialog
Left = 128
Top = 24
end
object PopupMenu1: TPopupMenu
Left = 684
Top = 4
object CloseTAB1: TMenuItem
Caption = 'Close TAB'
OnClick = CloseTAB1Click
end
end
object Timer1: TTimer
Enabled = False
Interval = 500
OnTimer = Timer1Timer
Left = 296
Top = 24
end
end
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Buttons, ComCtrls, StdCtrls, SHELLAPI, ExtCtrls, ShlObj, ActiveX,
Menus, ImgList, COMObj, commctrl;
type
TForm1 = class(TForm)
OpenDialog1: TOpenDialog;
Image1: TImage;
Image2: TImage;
Panel1: TPanel;
PageControl1: TPageControl;
TabSheet1: TTabSheet;
Label1: TLabel;
PopupMenu1: TPopupMenu;
CloseTAB1: TMenuItem;
ScrollBox1: TScrollBox;
SpeedButton1: TSpeedButton;
SpeedButton3: TSpeedButton;
SpeedButton4: TSpeedButton;
Timer1: TTimer;
procedure SpeedButton1Click(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure FormShow(Sender: TObject);
procedure CloseTAB1Click(Sender: TObject);
procedure SpeedButton3Click(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
procedure SpeedButton4MouseDown(Send er: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure SpeedButton4MouseUp(Sender : TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure SpeedButton4Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.SpeedButton1Click(S ender: TObject);
var
sp:TSpeedButton;
filename:string;
i:integer;
Info : TSHFileInfo;
InfoSize : Integer;
BitMap:TBitMap;
// pentru lnk files
descr,s1,s2 : string;
pidl : PItemIDList;
findData : TWin32FindData;
iconPath : string;
workingDir : string;
hotKey : string;
showCmd : integer;
begin
if OpenDialog1.Execute then
begin
filename := OpenDialog1.FileName;
sp:=TSpeedButton.Create(se lf);
sp.Parent:=ScrollBox1;
sp.Name:='btn'+Label1.Capt ion;
sp.ShowHint:=True;
InfoSize := SizeOf(TSHFileInfo);
FillChar(Info, InfoSize, 0);
SHGetFileInfo(PChar(filena me), 0, Info, InfoSize, SHGFI_ICON or SHGFI_SMALLICON);
Image1.Picture.icon.Handle := Info.hIcon;
Image1.Picture.Icon.SaveTo File('c:\p ic.ico');
Bitmap := TBitmap.Create;
Bitmap.Width := Image1.Picture.icon.Width- 16;
Bitmap.Height := Image1.Picture.icon.Height -16;
BitMap.TransparentColor:=c lWhite;
BitMap.Transparent:=true;
Bitmap.Canvas.Draw(0, 0, Image1.Picture.icon);
Bitmap.SaveToFile('c:\pic. bmp'); //Convert ICO to BMP!
Bitmap.Free;
sp.Glyph.LoadFromFile('c:\ pic.bmp');
sp.Hint:=filename;
sp.Flat:=true;
sp.Top:=1;
sp.Height:=27;
// sp.OnClick:=myOnClickEvent ;
sp.Width:=30;
sp.Left:=16+StrToInt(Label 1.Caption) *30;
sp.Refresh;
Label1.Caption:=IntToStr(S trToInt(La bel1.Capti on)+1);
end;
end;
// ************************** ********** ********** ********** ********** *****
procedure TForm1.SpeedButton3Click(S ender: TObject);
var
i, Min : Integer;
begin
if scrollbox1.ControlCount > 0 then // only if controls available
begin
min := scrollbox1.Controls[0].Lef t;
For I := 0 to scrollbox1.ControlCount - 1 do
if scrollbox1.Controls[I].Lef t < min then
begin
min := scrollbox1.Controls[I].Lef t;
end;
if min < 0 then
begin
ScrollBox1.ScrollBy(10,0);
end;
end;
end;
procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
//ShowMessage('TODO save of the buttons in an ini file and retrieve them upon startup of the application');
end;
procedure TForm1.FormShow(Sender: TObject);
begin
Form1.Align:=alTop;
end;
procedure TForm1.CloseTAB1Click(Send er: TObject);
begin
PageControl1.ActivePage.De stroy;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
var i, max : Integer;
begin
if scrollbox1.ControlCount > 0 then // only if controls available
begin
max := scrollbox1.Controls[0].Lef t + scrollbox1.Controls[0].Wid th;
For I := 0 to scrollbox1.ControlCount - 1 do
if scrollbox1.Controls[I].Lef t + scrollbox1.Controls[I].Wid th > max then
begin
max := scrollbox1.Controls[I].Lef t + scrollbox1.Controls[I].Wid th;
end;
if max > ScrollBox1.ClientWidth then
begin
ScrollBox1.ScrollBy(-10,0) ;
end;
end;
end;
procedure TForm1.SpeedButton4MouseDo wn(Sender: TObject;
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
Timer1.Enabled:=True;
end;
procedure TForm1.SpeedButton4MouseUp (Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
Timer1.Enabled:=False;
end;
procedure TForm1.SpeedButton4Click(S ender: TObject);
var i, max : Integer;
begin
if scrollbox1.ControlCount > 0 then // only if controls available
begin
max := scrollbox1.Controls[0].Lef t + scrollbox1.Controls[0].Wid th;
For I := 0 to scrollbox1.ControlCount - 1 do
if scrollbox1.Controls[I].Lef t + scrollbox1.Controls[I].Wid th > max then
begin
max := scrollbox1.Controls[I].Lef t + scrollbox1.Controls[I].Wid th;
end;
if max > ScrollBox1.ClientWidth then
begin
ScrollBox1.ScrollBy(-10,0) ;
end;
end;
end;
end.
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Buttons, ComCtrls, StdCtrls, SHELLAPI, ExtCtrls, ShlObj, ActiveX,
Menus, ImgList, COMObj, commctrl;
type
TForm1 = class(TForm)
OpenDialog1: TOpenDialog;
Image1: TImage;
Image2: TImage;
Panel1: TPanel;
PageControl1: TPageControl;
TabSheet1: TTabSheet;
Label1: TLabel;
PopupMenu1: TPopupMenu;
CloseTAB1: TMenuItem;
ScrollBox1: TScrollBox;
SpeedButton1: TSpeedButton;
SpeedButton3: TSpeedButton;
SpeedButton4: TSpeedButton;
Timer1: TTimer;
procedure SpeedButton1Click(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure FormShow(Sender: TObject);
procedure CloseTAB1Click(Sender: TObject);
procedure SpeedButton3Click(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
procedure SpeedButton4MouseDown(Send
Shift: TShiftState; X, Y: Integer);
procedure SpeedButton4MouseUp(Sender
Shift: TShiftState; X, Y: Integer);
procedure SpeedButton4Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.SpeedButton1Click(S
var
sp:TSpeedButton;
filename:string;
i:integer;
Info : TSHFileInfo;
InfoSize : Integer;
BitMap:TBitMap;
// pentru lnk files
descr,s1,s2 : string;
pidl : PItemIDList;
findData : TWin32FindData;
iconPath : string;
workingDir : string;
hotKey : string;
showCmd : integer;
begin
if OpenDialog1.Execute then
begin
filename := OpenDialog1.FileName;
sp:=TSpeedButton.Create(se
sp.Parent:=ScrollBox1;
sp.Name:='btn'+Label1.Capt
sp.ShowHint:=True;
InfoSize := SizeOf(TSHFileInfo);
FillChar(Info, InfoSize, 0);
SHGetFileInfo(PChar(filena
Image1.Picture.icon.Handle
Image1.Picture.Icon.SaveTo
Bitmap := TBitmap.Create;
Bitmap.Width := Image1.Picture.icon.Width-
Bitmap.Height := Image1.Picture.icon.Height
BitMap.TransparentColor:=c
BitMap.Transparent:=true;
Bitmap.Canvas.Draw(0, 0, Image1.Picture.icon);
Bitmap.SaveToFile('c:\pic.
Bitmap.Free;
sp.Glyph.LoadFromFile('c:\
sp.Hint:=filename;
sp.Flat:=true;
sp.Top:=1;
sp.Height:=27;
// sp.OnClick:=myOnClickEvent
sp.Width:=30;
sp.Left:=16+StrToInt(Label
sp.Refresh;
Label1.Caption:=IntToStr(S
end;
end;
// **************************
procedure TForm1.SpeedButton3Click(S
var
i, Min : Integer;
begin
if scrollbox1.ControlCount > 0 then // only if controls available
begin
min := scrollbox1.Controls[0].Lef
For I := 0 to scrollbox1.ControlCount - 1 do
if scrollbox1.Controls[I].Lef
begin
min := scrollbox1.Controls[I].Lef
end;
if min < 0 then
begin
ScrollBox1.ScrollBy(10,0);
end;
end;
end;
procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
//ShowMessage('TODO save of the buttons in an ini file and retrieve them upon startup of the application');
end;
procedure TForm1.FormShow(Sender: TObject);
begin
Form1.Align:=alTop;
end;
procedure TForm1.CloseTAB1Click(Send
begin
PageControl1.ActivePage.De
end;
procedure TForm1.Timer1Timer(Sender:
var i, max : Integer;
begin
if scrollbox1.ControlCount > 0 then // only if controls available
begin
max := scrollbox1.Controls[0].Lef
For I := 0 to scrollbox1.ControlCount - 1 do
if scrollbox1.Controls[I].Lef
begin
max := scrollbox1.Controls[I].Lef
end;
if max > ScrollBox1.ClientWidth then
begin
ScrollBox1.ScrollBy(-10,0)
end;
end;
end;
procedure TForm1.SpeedButton4MouseDo
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
Timer1.Enabled:=True;
end;
procedure TForm1.SpeedButton4MouseUp
Shift: TShiftState; X, Y: Integer);
begin
Timer1.Enabled:=False;
end;
procedure TForm1.SpeedButton4Click(S
var i, max : Integer;
begin
if scrollbox1.ControlCount > 0 then // only if controls available
begin
max := scrollbox1.Controls[0].Lef
For I := 0 to scrollbox1.ControlCount - 1 do
if scrollbox1.Controls[I].Lef
begin
max := scrollbox1.Controls[I].Lef
end;
if max > ScrollBox1.ClientWidth then
begin
ScrollBox1.ScrollBy(-10,0)
end;
end;
end;
end.
Forced accept.
Computer101
EE Admin
Computer101
EE Admin
https://www.experts-exchange.com/questions/22007174/Delphi-PageScroller-Query.html
Regards