Solved

DBGrid Scrollbars

Posted on 1998-03-08
3
1,188 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

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…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

744 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now