Windows Develop Bookmark and Share   
 index > Windows Forms Sample Applications > To rotate the control in .net 2005 in c#
 

To rotate the control in .net 2005 in c#

Hi Friends,

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

waiting for the positive reply.

Chetan
Chetan VD  Friday, December 19, 2008 1:13 PM
I am pretty 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.
ZuechB  Friday, December 19, 2008 8:18 PM
I am pretty 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.
ZuechB  Friday, December 19, 2008 8:18 PM
Hi Chetan,

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-inbehavior/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:
http://msdn.microsoft.com/en-us/library/system.windows.controls.control.template.aspx

http://blah.winsmarts.com/2007-2-WPF__ControlTemplate_-_Completely_Swapping_the_UI_of_an_Element.aspx

http://msdn.microsoft.com/en-us/library/system.windows.forms.integration.elementhost.aspx

http://msdn.microsoft.com/en-us/library/ms745781.aspx

Hope this helps.

Sincerely,
Linda Liu
Linda Liu  Monday, December 22, 2008 8:37 AM
Hi ZuechB

Thanks for the helpful suggestions sure i will consider your suggestions

thanks and regards
Chetan

Chetan
Chetan VD  Monday, December 22, 2008 11:09 AM
Hi Linda Liu

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

Thanks for the valuable suggestions

thanks and regards

Chetan

Chetan
Chetan VD  Monday, December 22, 2008 11:15 AM

You can use google to search for other answers

Custom Search

More Threads

• Offline filtering dataset with databinding to text boxes
• list all forms in a c# project
• PocketVision vs Offline App Block
• video tutorials needed for learning C#
• TaskListControl
• Update Web Refrence Problem (Issue Vision)
• PROBLEM: The remote server is unreachable or request has timed-out
• Who created this bug? (intended)
• Visual Studio.net cannot find "System.Drawing"
• Issue Vision Expandable List Control