How to Rotate Controls?
-
Hi, I want to rotate a control, take for example a button Control or a label control to some angle. But i dont know how to attain that.. i tried setting the region of the control with a graphics path whose transform set to rotate about its center...but im not able to get the output... Can anybody help me? Thanks, Rajesh
-
Hi, I want to rotate a control, take for example a button Control or a label control to some angle. But i dont know how to attain that.. i tried setting the region of the control with a graphics path whose transform set to rotate about its center...but im not able to get the output... Can anybody help me? Thanks, Rajesh
Off the top of my head, you'll have to create your own version of the controls you want to visually rotate and supply the functionality for it. There may be another way to do it by dropping the controls in some other container and rotating the container somehow, but i really can't see that happening. Another option is a 3rd party Windows Forms Control library. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-
Off the top of my head, you'll have to create your own version of the controls you want to visually rotate and supply the functionality for it. There may be another way to do it by dropping the controls in some other container and rotating the container somehow, but i really can't see that happening. Another option is a 3rd party Windows Forms Control library. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
Right off the very tip top of my head.... Could you just decrement the X size/location and increment the Y size/location in a for loop (or do loop)? The text wouldn't rotate, but the control would appear too. Just a thought. Of course you have to mark your start position and reverse at 90 degrees, etc, etc... www.lovethosetrains.com
-
Right off the very tip top of my head.... Could you just decrement the X size/location and increment the Y size/location in a for loop (or do loop)? The text wouldn't rotate, but the control would appear too. Just a thought. Of course you have to mark your start position and reverse at 90 degrees, etc, etc... www.lovethosetrains.com
No, it wouldn't. It would just make the button appear tall and narrow, not rotated to any angle. Re-read the original post... RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-
No, it wouldn't. It would just make the button appear tall and narrow, not rotated to any angle. Re-read the original post... RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
Actually i tried transforming the region of the control to a rotation... for example, Region reg = new Region(); Matrix matObj = new Matrix(); matObj.RotateAt(/*some angle*/, /*with respect to some point*/); reg.Transform(matobj); myControl.Region = reg; Iam able to attain the rotation...but supposing the region (reg in this example)is in another shape(than rectangle)...say ellipse, then the shape of the ellipse is not visible completely....reason is that the rectangle coordinates(i.e. the original rectangle size) used to draw the ellipse is smaller than the rotated structure...(after rotation, the location of points are actually out of the bounds of the controls client rectangle...) So i tried to get the size of the outer rectangle which has completely both the original and the rotated rectangles... by some trignometry... but nope, im not getting the exact coordinates... can you help me in this?? I Thanks and Regards, Rajesh