[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 520
  • Last Modified:

Borland C++ Builder component position?

When i open my designed programme (using Borland Builder) in my friend computer, the components in the form are not in the appropriate position as in my computer. We are using the same window screen area setting 800 x 600. How to rectify this problem to let my designed programmme can be used internationally?
0
tanpohlai
Asked:
tanpohlai
  • 2
  • 2
1 Solution
 
AlexVirochovskyCommented:
Simple in you
void __fastcall TForm1::FormActivate(TObject *Sender)
function make code as (psevdocode)
{
  for all my controls
    {
      control[i].left = ArrayLelf[i]
      control[i].top = ArrayTop[i]
    }
}
And you controls will be in Predefined place.
I hope, it helps. Alex
0
 
tanpohlaiAuthor Commented:
This cannot solve my problem.
My actual problem is that how to open a program in any setting like LARGE font or Normal font, screen size 800 x 600, or 640 x 480 without affecting the original position and the size of my programme.
I develope my program in 800 x 600 and Large font setting, when i open in other 640 x 480 and small font configuration computer, the position and size is different.
How to make my program internationally compatible?
0
 
tanpohlaiAuthor Commented:
Adjusted points to 80
0
 
AlexVirochovskyCommented:
1. To get Current resolution:
Get current resolution:
int cx = GetSystemMetrics(SM_CXSCREEN),
cy = GetSystemMetrics(SM_CYSCREEN));

2. To know size of curent System Font:

  NONCLIENTMETRICS non;
  memset(&non, 0, sizeof(non));
  non.cbSize = sizeof(non);
  SystemParametersInfo(SPI_GETNONCLIENTMETRICS,0, &non,0);
  if (non.lfCaptionFont.lfHeight > 11) //large
    {
    }
  else if (non.lfCaptionFont.lfHeight < 11) //small
    {
    }
  else//usual
    {
    }

  non.lfCaptionFont.lfHeight - is  
Height of System Font!
Other way for same thing:
In System Registry
  HKEY_CURRENT_CONFIG\Display\Settings" has value-name pairs like "DPILogicalX" and "DPILogicalY". : size(x, y) of
system Font!

If you know all this data, you
can make pedefinded constants and .. see my previous reply.
Alex

0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now