was ist neu ¦  programmier tips ¦  indy artikel ¦  intraweb artikel ¦  informationen ¦  links ¦  interviews
 sonstiges ¦  tutorials ¦  Add&Win Gewinnspiel

Tips (1541)

Dateien (137)
Datenbanken (90)
Drucken (35)
Grafik (114)
IDE (21)
Indy (5)
Internet / LAN (130)
IntraWeb (0)
Mathematik (76)
Multimedia (45)
Oberfläche (107)
Objekte/
ActiveX (51)

OpenTools API (3)
Sonstiges (126)
Strings (83)
System (266)
VCL (242)

Tips sortiert nach
Komponente


Tip suchen

Tip hinzufügen

Add&Win Gewinnspiel

Werbung

35 Visitors Online


 
...die Scrollbars eines DBGrids ausblenden?
Autor: P. Below
[ Tip ausdrucken ]  

Tip Bewertung (23):  
     


(*

Q:
I want to hide the vertical scrollbar on a dbgrid when the record count
exceed a number. How can I do that?

A:
Make a descendent of the TDBGrid class. Add a handler for the
WM_NCCALCSIZE message.

*)

type
  
TNoScrollDBGrid = class(TDBGrid)
  private
    procedure 
WMNCCalcSize(var Msg: TMessage);
      message WM_NCCALCSIZE;
  end;

procedure TNoScrollDBGrid.WMNCCalcSize(var Msg: TMessage);
const
  
Scrollstyles = WS_VSCROLL or WS_HSCROLL;
var
  
Style: Integer;
begin
  
Style := GetWindowLong(Handle, GWL_STYLE);
  if (Style and Scrollstyles) <> 0 then
    
SetWindowLong(Handle, GWL_STYLE, Style and not Scrollstyles);
  inherited;
end;

//This removes both scrollbars. If you want to remove only the vertical one
//change the scrollstyles constant accordingly.


 

Bewerten Sie diesen Tipp:

dürftig
ausgezeichnet


Copyright © by SwissDelphiCenter.ch
All trademarks are the sole property of their respective owners