Rotated form?

  • Thread starter Thread starter Jamie Border
  • Start date Start date
J

Jamie Border

Odd question:

I have some Forms that I have to display rotated 90 degrees clockwise (don't
ask! :-)

Right now I'm doing it by hiding the Form offscreen, grabbing the DC,
rotating it and blitting it onto another Form's DC (well actually a
PictureBox).

Currently I have to handle all event forwarding myself.

Is there a better way to approach this?

Jamie
 
Hi Jamie,

Perhaps you might consider WPF aka Avalon if you don't need it right now.
 
Unfortunately the way you're doing it is the best method. Usually the
orientation of the form is a function of the low-level driver software. This
can be controlled on Tablet PC systems for example but not for other types
of systems unless you can get a custom driver.


--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
 
Bob said:
Unfortunately the way you're doing it is the best method. Usually the
orientation of the form is a function of the low-level driver software. This
can be controlled on Tablet PC systems for example but not for other types
of systems unless you can get a custom driver.

Unfortunately I am tied to one particular driver, so no custom rotation
in driver code for me, otherwise I would be merrily re-writing the
graphics driver.

I should have mentioned - these Forms are "fullscreen", that is:

* They are (design-time) 768x1024 and (rotated) 1024x768
* No non-client stuff (no frame, no title bar etc.)

The problem is that the (original) Form is created at 768x768 (square).

This means that after I rotate it I am left with a blank area 'outside'
the Form.

The form is built offscreen, but I can't seem to tell it that being
bigger than PrimaryScreen.Bounds is what I want.


I've tried sending the Form WM_SIZE et al, but to no avail - it seems
the Control gets a WM_SIZING or some such and changes my "768x1024" to
"768x768".

Is there a way to override this somewhere? I feel that I am fighting
the system somewhat.

Jamie
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top