问题
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:
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.
来源:https://stackoverflow.com/questions/27278525/how-can-i-fixate-form-for-tablet-pc-in-delphi-xe2