How can I fixate form for tablet PC in Delphi XE2?

182 views Asked by At

I have a problem. I create a fullscreen form in Delphi XE2. Then I run my application on tablet PC with windows 7 on board where screen resolution is 1024x600. Then I rotate tablet PC (now resolution is 600x1024) and I had some problems with elements on form (some buttons are behind the screen, etc.). Can I configure project so that when I turn the tablet PC my form is not rotate?

1

There are 1 answers

2
David Heffernan On

According to this MSDN article you can detect that the screen has been rotated by listening for the WM_DISPLAYCHANGE message.

However, you then face a serious problem. You now need to paint your entire app with a 90 degree rotation. That's going to take quite a bit of doing. I honestly don't believe it to be a tractable solution. I suspect that the viable options are to:

  • Modify your program so that it works in both orientations, or
  • Configure the device so that it is always in your preferred orientation.