Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > General

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
Old 04-24-2001, 03:25 AM
Eduardo Eduardo is offline
Senior Member
 
Join Date: Apr 2001
Posts: 277
Default NoScroll

I'm using a TListBox to show some information. However i want to HIDE de scrollbar at de right. Is this possible?
I know that a TMemo box can be used but i need OnDrawItem.
Pleas help me out...
Reply With Quote
  #2  
Old 04-24-2001, 10:04 AM
Tavares Tavares is offline
Senior Member
 
Join Date: Feb 2001
Posts: 1,318
Default RE: NoScroll

Doesnt TListBox has a property called ScrollBar where you choose if you want or not?
Take a look at this and let me know.

Regards,
Eduardo Tavares
www.tavareswebsite.cjb.net
Reply With Quote
  #3  
Old 04-25-2001, 12:22 AM
Eduardo Eduardo is offline
Senior Member
 
Join Date: Apr 2001
Posts: 277
Default RE: RE: NoScroll

No, there is no scrollbar available. Not visible en not invisible.
Reply With Quote
  #4  
Old 04-25-2001, 12:29 AM
Tavares Tavares is offline
Senior Member
 
Join Date: Feb 2001
Posts: 1,318
Default RE: NoScroll

I didnt find nothing about hide but I found about disable, is it alright?

The arrows of horizontal and vertical scrollbars can be individually disabled or enabled by sending the message 'SBM_ENABLEARROWS'.

The wparam ofthe message can have the following values

ESB_DISABLE_BOTH Disables both arrows on a scroll bar.
ESB_DISABLE_DOWN Disables the down arrow on a vertical scroll bar.
ESB_DISABLE_LTUP Disables the left arrow on a horizontal scroll bar or the up arrow on a vertical scroll bar.

ESB_DISABLE_LEFT Disables the left arrow on a horizontal scroll bar.
ESB_DISABLE_RTDN Disables the right arrow on a horizontal scroll bar or the down arrow on a vertical scroll bar.
ESB_DISABLE_UP Disables the up arrow on a vertical scroll bar.
ESB_ENABLE_BOTH Enables both arrows on a scroll bar.


Below is a sample code.

Add a scrollbar and 6 buttons to a form.

unit ScrollBarEnable;

interface

uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ToolWin, ComCtrls, Buttons, ExtCtrls, StdCtrls;

type
TForm1 = class(TForm)
ScrollBar1: TScrollBar;
Button1: TButton;
Button2: TButton;
Button3: TButton;
Button4: TButton;
Button5: TButton;
Button6: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Button4Click(Sender: TObject);
procedure Button5Click(Sender: TObject);
procedure Button6Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.Button1Click(Sender: TObject);
begin
SendMessage(scrollbar1.handle,SBM_ENABLE_ARROWS,ES B_DISABLE_BOTH,0);
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
SendMessage(scrollbar1.handle,SBM_ENABLE_ARROWS,ES B_ENABLE_BOTH,0);
end;

procedure TForm1.Button3Click(Sender: TObject);
begin
SendMessage(scrollbar1.handle,SBM_ENABLE_ARROWS,ES B_ENABLE_BOTH,0);
SendMessage(scrollbar1.handle,SBM_ENABLE_ARROWS,ES B_DISABLE_RIGHT,0);
end;

procedure TForm1.Button4Click(Sender: TObject);
begin
SendMessage(scrollbar1.handle,SBM_ENABLE_ARROWS,ES B_DISABLE_LEFT,0);
end;

procedure TForm1.Button5Click(Sender: TObject);
begin
SendMessage(scrollbar1.handle,SBM_ENABLE_ARROWS,ES B_ENABLE_BOTH,0);
SendMessage(scrollbar1.handle,SBM_ENABLE_ARROWS,ES B_DISABLE_LEFT,0);
end;

procedure TForm1.Button6Click(Sender: TObject);
begin
SendMessage(scrollbar1.handle,SBM_ENABLE_ARROWS,ES B_DISABLE_RIGHT,0);
end;

Taken from Delphi3000

Regards,
Eduardo Tavares
www.tavareswebsite.cjb.net
Reply With Quote
  #5  
Old 04-25-2001, 01:21 AM
Eduardo Eduardo is offline
Senior Member
 
Join Date: Apr 2001
Posts: 277
Default RE: RE: NoScroll

Sorry does not work with TListbox.
I saw this one:
SendMessage(PlayList.Handle,LB_SETHORIZONTALEXTENT ,500,0);
Very nice but only for horizontal.
Is there something like SETVERTIKAL... maybe this wil work.
Greetings.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT. The time now is 09:04 PM.


Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2019, vBulletin Solutions, Inc.