English 中文(简体)
我如何阻止一种形式超过窗口高峰?
原标题:How do I stop a form from exceeding the window height?
  • 时间:2011-04-05 07:38:19
  •  标签:
  • delphi

我的形式超过了窗口的高度(当我使用改变小组的高度的分裂器时,改变了形形状的大小)。

我怎么能够阻止它像现在这样重新思考?

最佳回答

我假定你会重新改变形式规模,因为我无法找到办法使分裂者自动这样做。 可以通过<代码>Screen的标注进入/code>的屏幕。 你可以简单地测试<代码>Screen。 Height,或者,如果你想更好地支持多个监测员,则测试<代码>Screen. MonitorFromWindow(Handle)。 Height

未经测试的法典样本应当开始:

var MaxFormHeight: Integer;
    NewFormHeight: Integer;
    M: TMonitor;
begin
  // Get the monitor that s hosting the form
  M := M := Screen.MonitorFromWindow(Handle);     
  MaxFormHeight := M.WorkAreaRect.Bottom - M.WorkAreaRect.Top - Top; // Take into account actual available monitor space and the Top of the window
  // Do your stuff to calculate NewFormHeight
  if NewFormHeight > MaxFormHeight then
    NewFormHeight := MaxFormHeight;
  Height := NewFormHeight;
end;
问题回答

暂无回答




相关问题
determining the character set to use

my delphi 2009 app has a basic translation system that uses GNUGetText. i had used some win API calls to prepare the fonts. i thought it was working correctly until recently when someone from Malta ...

Help with strange Delphi 5 IDE problems

Ok, I m going nuts here. For the last (almost) four years, I ve been putting up with some extremely bad behavior from my Delphi 5 IDE. Problems include: Seemingly random errors in coride50.bpl ...

How to write a Remote DataModule to run on a linux server?

i would like to know if there are any solution to do this. Does anyone? The big picture: I want to access data over the web, using my delphi thin clients. But i´would like to keep my server/service ...

How convert string to integer in Oxygene

In Delphi, there is a function StrToInt() that converts a string to an integer value; there is also IntToStr(), which does the reverse. These functions doesn t appear to be part of Oxygene, and I can ...

Quick padding of a string in Delphi

I was trying to speed up a certain routine in an application, and my profiler, AQTime, identified one method in particular as a bottleneck. The method has been with us for years, and is part of a "...

热门标签