Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How to Disable the Vertical Scrollbar in the TDBGrid object

Posted on 2004-04-24
11
Medium Priority
?
4,804 Views
Last Modified: 2011-03-06
I am using Delphi 7
I have a DBGrid object that shows a database table with just 5 records
The horizontal scroll bar only shows when the columns are bigger than the avaliable space, but vertical scrollbar shows always no mather the number of records

I don't want the vertical scrollbar to show at all on the grid, never.

Please help...
0
Comment
Question by:EternalNewbie
[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
  • 6
  • 3
  • 2
11 Comments
 
LVL 17

Expert Comment

by:mokule
ID: 10908485

Place neat Panel on it
0
 

Author Comment

by:EternalNewbie
ID: 10908499
humm. is that "Neat panel" a standard Delphi component ?  
Can't remember of seeing it ?

if is notm would you please let me know where I can find it ?
0
 
LVL 17

Expert Comment

by:mokule
ID: 10908512

I mean standard TPanel neatly placed :)
0
Industry Leaders: 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!

 

Author Comment

by:EternalNewbie
ID: 10908527
You mean a panel placed over the grid to hide the scrollbar ?

I am placing like 7 grids side by side to make a dinamic agenda ( 7 week days, 7 grids).

I guess I can place the grids to overwrite eachother and a panel on last one but that doesnt seem a professional way to do it. it must be a way to set the verticalscroll not to show.

I read that it can be done using TCustomGrid, but I don't know how to use that TCustomGrid.

0
 
LVL 17

Expert Comment

by:mokule
ID: 10908547

Yes I mean to hide every of Your 7 scroll bars with Tpanels. It'll be the fasted way to do it. There is no easy way of gettig rid of verticel scroll bar in DBGrid. At least I don't know it. If You set panel to be flat there will be no difference in look.
0
 
LVL 11

Assisted Solution

by:shaneholmes
shaneholmes earned 200 total points
ID: 10908556

You need to make a new component derived from TDBGrid for this. The
following shows an example for a TDBGRID descendent but the strategy
works with about every control that uses standard window scrollbars.

type
  TNoVScrollTDBGrid = Class( TDBGrid )
  private
    Procedure WMNCCalcSize( Var msg: TMessage );
      message WM_NCCALCSIZE;
  end;
 
procedure TNoVScrollDBGrid.WMNCCalcSize(var msg: TMessage);
var
  style: Integer;
begin
  style := getWindowLong( handle, GWL_STYLE );
  If (style and WS_VSCROLL) <> 0 Then
    SetWindowLong( handle, GWL_STYLE, style and not WS_VSCROLL );
  inherited;
end;


Shane
0
 
LVL 17

Accepted Solution

by:
mokule earned 300 total points
ID: 10908562

If You really want to fight with it You can also use

  ShowScrollBar(DBGrid1.Handle,SB_VERT,FALSE);
1
 

Author Comment

by:EternalNewbie
ID: 10908613
Perfect.

yours line works great mokule.

but shane, you've got me interested on that way to derive a component from another. I have read about it and looks the way to custumise about anything, even that I couldnt put it to work, still you've givven me material to try and learn.

I really feel bad about spliting points, but I feel that otherwise would be unfair.

Really hope no one gets hurt.

0
 
LVL 17

Expert Comment

by:mokule
ID: 10908808
Why do You feel bad while splitting points?
It's quite normal when You get real help from more than one person.
1
 
LVL 11

Expert Comment

by:shaneholmes
ID: 10908832
Some points are better than none - Im sure Mokule can concur?

Shane
0
 
LVL 17

Expert Comment

by:mokule
ID: 10908883
Thats it :)
0

Featured Post

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

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…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

636 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