delphi - detect if the scrollbars of a form are visible in an mdi child -
I have not come to know that a scrollbar is visible or not by passing through the Internet shows that The code should work. Everyone uses it:
function VertScrollBarVisible (window: Thandal): boolean; Start the result: = (GetWindowlong (Window Hight, GWLEGel) and WS_VSCROLL) & lt; & Gt; 0 end;
I call it like this:
Process TFrmBaser.Button1Click (Sender: Tubect); Then start if VertScrollBarVisible (MainForm.Handle) caption: = 'visible'; End;
It lied all the time, even scrollbar appear. They are seen by some MDI baby forms which I draw a little bit from the screen.
Delphi 7, Win XP SP3, Theme
This
This is incorrect at all times, even scrollbars are visible, they are visible by some MDI child forms that I pull a little bit from the screen.
This shows that the form with which you are having trouble is in the form of a MDI parent (
FormStyle
isfsMDIForm < / Code>).
MDI guardian forms are different from normal forms, in which they create a special client window that fills the entire customer area, and the MDI hair windows / MDI client window, your parent's client area Never will be larger than, so the parent's form will never show scrollbar. It shows that the code of your question always goes wrong.
The scrollbar you are viewing is a part of the MDI client window. To see the window style of the client window, modify its code, its handle can be accessed by the property of
ClientHandle
MDI Parent form:Process TFrmBaser. Button1Click (Sender: Toबेस); If start VertScrollBarVisible (MainForm.ClientHandle) caption then start: = 'visible'; End;
For more information about MDI at the Windows API level, see MSDN.
Comments
Post a Comment