Solved

Screen resolution and TDrawgrid

Posted on 2000-05-14
3
129 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Delphi XE2 application frozen on Windows 10 10 337
Error E2158 compiling with Delphi XE10 Seattle 2 112
DBGrid or StringGrid ? 6 103
Delphi: making a BW image transparent 10 57
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…
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…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

792 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