IT Community - Software Programming, Web Development and Technical Support

To rotate the control in .net 2005 in c#

This is a discussion on To rotate the control in .net 2005 in c# within the C# Programming forums, part of the Software Development category; To rotate the control in .net 2005 in c# I want to rotate the controls that means in normal application ...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Software Development > C# Programming

Register FAQ Members List Calendar Mark Forums Read
  #1  
Old 05-27-2009, 12:01 AM
bluesky bluesky is offline
D-Web Architect
 
Join Date: Jun 2007
Posts: 667
bluesky is on a distinguished road
Default To rotate the control in .net 2005 in c#

To rotate the control in .net 2005 in c#

I want to rotate the controls that means in normal application when we drag and drop a control take for example a label by default the orientation of the text will be horizontal but for me i want it in a vertical manner (in 90 degrees).

So my main requirement is irrespective of control whether it is a label or button or textbox etc... it should be possible to rotate the control by 90 Degree and also the text inside the control...

I need a help in this regard, since in winforms there are a lot of controls and i don't know how to approach this issue
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2  
Old 05-27-2009, 12:02 AM
shaalini shaalini is offline
D-Web Architect
 
Join Date: Apr 2007
Posts: 633
shaalini is on a distinguished road
Default Re: To rotate the control in .net 2005 in c#

Hi,

I am sure you can not perform this in windows forms at least not easily. However you can perform this in WPF and then bring WPF to your windows Form if you are looking for cool designs or even special effects to your controls.
__________________
Shaalini.S
Be the Best of Whatever you are...
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3  
Old 05-27-2009, 12:03 AM
arjkhanna arjkhanna is offline
D-Web Incredible
 
Join Date: Mar 2007
Posts: 1,949
arjkhanna is on a distinguished road
Default Re: To rotate the control in .net 2005 in c#

Hi,

It's not easy to do what you want on the WinForm controls. It requires you to create a custom control for each standard .NET control you'd like and custom draw the appearance. What's more, not all standard .NET control allow you to change its appearance completely.

As ZuechB has pointed out, you can WPF controls instead because we can change the appearance of all WPF controls completely without losing any built-in behavior/function of the WPF controls. Then you can integrate the WPF controls into your WinForm using the ElementHost control.

For more information, refer to the following documents:
Control.Template Property (System.Windows.Controls)

WPF: ControlTemplate - Completely Swapping the UI of an Element. | Sahil Malik - blah.winsmarts.com

ElementHost Class (System.Windows.Forms.Integration)

Walkthrough: Hosting a Windows Presentation Foundation Composite Control in Windows Forms
__________________
A.Rajesh Khanna
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4  
Old 05-27-2009, 12:04 AM
bluesky bluesky is offline
D-Web Architect
 
Join Date: Jun 2007
Posts: 667
bluesky is on a distinguished road
Default Re: To rotate the control in .net 2005 in c#

Hi all,

Thanks for the helpful suggestions sure i will consider your suggestions


Even i was thinking how to implement this... but the suggestions given by ZuechB and you i understand that we can implement in WPF easily rather than doing in 2.0 winforms
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I run all VS Pro 2003, 2005 and 2008 as clients with VS Team System 2005? shaalini Server Management 1 05-08-2009 03:08 AM
use of Custom Control and User Control? a.deeban ASP and ASP.NET Programming 1 08-20-2007 07:25 AM
How to Rotate a Dynamic Text box.. I have problem in ... kingmaker Flash Actionscript Programming 2 07-30-2007 01:07 AM
How to rotate 3d objects using j2me? mobilegeek J2ME 1 07-24-2007 05:36 AM
How to rotate 3d objects using j2me? mobilegeek J2ME 1 07-23-2007 09:46 PM


All times are GMT -7. The time now is 01:54 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.
Our Partners
One Way Moving Companies | Stamford Dentist | Euro Millions Lottery | Home Loans| Furniture

SEO by vBSEO 3.0.0