Solved

DBGrid Scrollbars

Posted on 1998-03-08
3
1,202 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

705 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