Solved

DBGrid Scrollbars

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

861 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

23 Experts available now in Live!

Get 1:1 Help Now