Solved

Screen resolution and TDrawgrid

Posted on 2000-05-14
3
130 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
[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
  • 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
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…

739 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