Screen resolution and TDrawgrid

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

Question by:ws1999
  • 3
LVL 15

Expert Comment

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;
  h : hDC;
  Result := 0;
    h := GetDC( 0 );
    Result :=1 shl (GetDeviceCaps(h, PLANES) *
        GetDeviceCaps(h, BITSPIXEL));
    ReleaseDC( 0, h );


LVL 15

Expert Comment

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.


LVL 15

Accepted Solution

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

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

Title # Comments Views Activity
ddeman not working in activex 3 93
indy Tmemory stream non latin charcter issue 2 98
Magic Software info 18 125
update joined tables 2 31
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…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
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…
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

896 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

13 Experts available now in Live!

Get 1:1 Help Now