Recent

Author Topic: [SOLVED] Strange Window Location Problem?  (Read 10981 times)

Deepaak

  • Sr. Member
  • ****
  • Posts: 454
Re: Strange Window Location Problem?
« Reply #15 on: January 27, 2013, 12:06:30 pm »
I haven't tried it but I think TWindowInfo will give you the same problem.

This is just a thought:

1. Create the Form with BorderStyle:= bsSizable completely off-screen or Invisible.

2. Store the Size info.

3. Change the BorderStyle:= bsDialog.

4. Move the Form to the location you want based on the stored Size info.

done as you said, works like a charm for bsSizeable but for bsDialog result is not upto mark.
attaching screenshot so you can understand,

Image 1.png has borderstyle = dialog
and image 2.png has borderstyle = sizeable

I can't understand, if the values are correct, then why there is error of margin.
what is creating this difference between dialog and sizeable window.

Is there any way to avoid resize on borders as it is a sizeable window.
« Last Edit: January 27, 2013, 12:22:23 pm by deepaak99 »
Holiday season is online now. :-)

Avishai

  • Hero Member
  • *****
  • Posts: 1021
Re: Strange Window Location Problem?
« Reply #16 on: January 27, 2013, 12:46:52 pm »
This is not something I have tried before so I had never noticed the problem.  But it looks like a bug in the Dialog Create method.  I just made a test.  A Form with 2 buttons and 2 Labels.  Clicking Button 1 changed the FormStyle to Dialog and Button 2 changed it to Sizeable.  Label 1 showed Screen coordinates for the Dialog and Label 2 for the Sizeable.

Just like in your test, both Labels showed the some information, but the location was not the same.

Here is another idea.  Instead of using Dialog, try using Sizable but in the BorderIcons, turn off biMaximize and biMinimize.  This will make it look the same as Dialog.  Maybe it will give you what you need.  If not, I don't have any other ideas.
« Last Edit: January 27, 2013, 12:54:25 pm by Avishai »
Lazarus Trunk / fpc 2.6.2 / Win32

Deepaak

  • Sr. Member
  • ****
  • Posts: 454
Re: Strange Window Location Problem?
« Reply #17 on: January 27, 2013, 12:51:58 pm »
This is not something I have tried before so I had never noticed the problem.  But it looks like a bug in the Dialog Create method.  I just made a test.  A Form with 2 buttons and 2 Labels.  Clicking Button 1 changed the FormStyle to Dialog and Button 2 changed it to Sizeable.  Label 1 showed Screen coordinates for the Dialog and Label 2 for the Sizeable.

Just like in your test, both Labels showed the some information, but the location was does the same.

Here is another idea.  Instead of using Dialog, try using Sizable but in the BorderIcons, turn off biMaximize and biMinimize.  This will make it look the same as Dialog.  Maybe it will give you what you need.  If not, I don't have any other ideas.


I had too checked with delphi and visual basic, the result are same as lazarus. So i guess it is some kind of window bug, not lazarus.
only C++ is left for checking if the result is same then it is a window bug.

Thanks for giving your valuable suggestion, I will continue as you had guided..
Thanks once again.
 :)
Holiday season is online now. :-)

 

TinyPortal © 2005-2018