Solved

DBGrid Scrollbars

Posted on 1998-03-08
3
1,200 Views
Last Modified: 2008-02-01
I had it all figured out in Delphi2. No vertical scrollbars on DBGrid just takes:
procedure TMain.DisableVertBar(GridHandle:THandle);
var VScrollInfo : TScrollInfo;
begin
VScrollInfo.cbSize := Sizeof (VScrollInfo);
VScrollInfo.fMask := SIF_PAGE;
SetScrollInfo(GridHandle, SB_VERT, VScrollInfo, True);
end;

In D3,the scrollbar is gone alright,untill I click the form!
Do I have to do somethong else in D3?
0
Comment
Question by:lizzzard
  • 2
3 Comments
 
LVL 1

Accepted Solution

by:
RJENKINS earned 50 total points
ID: 1360267
Try using this component,
it allows you to have the VertBar on or off.

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,Grids, DBGrids;

type
  TNVDBGrid = class(TDBGrid)
  private
   FVertScr: Boolean;
   procedure SetVertScr(Value: Boolean);
  protected
    procedure Paint; override;
  public
    constructor Create(AOwner: TComponent); override;
  published
  property VertScrollBar: Boolean read FVertScr write SetVertScr;
  end;

procedure Register;

implementation

constructor TNVDBGrid.Create(AOwner: TComponent);
begin
  Inherited;
  FVertScr := True;
end;

procedure TNVDBGrid.SetVertScr(Value: Boolean);
begin
  if Value <> FVertScr then
  begin
    FVertScr := Value;
    Repaint;
  end;
end;

procedure TNVDBGrid.Paint;
begin
  if not FVertScr then
    SetScrollRange(Self.Handle, SB_VERT, 0, 0, False);
  inherited Paint;
end;

procedure Register;
begin
  RegisterComponents('Data Controls', [TNVDBGrid]);
end;


Hope this helps
RCJ
0
 
LVL 1

Expert Comment

by:RJENKINS
ID: 1360268
Are you going to grade this answer
RCJ
0
 

Author Comment

by:lizzzard
ID: 1360269
I'm sorry,RJenkins,I've been very busy with another app. I will try it right away. Expect the grading this weekend
Thank you for your patience,
Regards,Lizzzy
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

790 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question