Solved

Screen resolution and TDrawgrid

Posted on 2000-05-14
3
128 Views
Last Modified: 2010-04-04
1. How to determine the presnet screen resolution?

2.Please give me a sample code as how to input data to a Drawgrid object from a database? I have seen so many manuals about drawgrid , but there is no code anymore.

Thanks
0
Comment
Question by:ws1999
  • 3
3 Comments
 
LVL 15

Expert Comment

by:simonet
ID: 2807932
There are actually 2 questions. Please split them so it's easier for you to properly grade the experts.

1) Use Screen.height and Screen.Width
In order to get the screen's color depth, use this code:

function GetColorsCount : integer;
var
  h : hDC;
begin
  Result := 0;
  try
    h := GetDC( 0 );
    Result :=1 shl (GetDeviceCaps(h, PLANES) *
        GetDeviceCaps(h, BITSPIXEL));
  finally
    ReleaseDC( 0, h );
  end;
end;


Yours,

Alex
0
 
LVL 15

Expert Comment

by:simonet
ID: 2807934
2) You don't generally use TDrawGrid for database access. Use TDBGrid for that. It's available in the "Data controls" tab of the component palette.

Yours,

Alex
0
 
LVL 15

Accepted Solution

by:
simonet earned 200 total points
ID: 2971418
simonet has changed his comments to an answer
0

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Best Firemonkey component pack 1 105
Printing problem 2 95
Delphi IDE crash without error message ... 7 91
Convert GUI app into console app for Win32 Env 5 100
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

809 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