getting the region of a usercontrol ? (for rotation) 
Author Message
 getting the region of a usercontrol ? (for rotation)

How do I get the region of a UserControl ?
Control class has a property Region but its always empty.

I need the region so that I can rotate my control, is this possible?
Thanks in advance



Sat, 29 May 2004 06:42:42 GMT  
 getting the region of a usercontrol ? (for rotation)
Eduardo,
Your UserControl would need to define and set Control.Region so that you
could use it later...

See the System.Drawing.Region class...

When you are painting your UserControl, how do you know what the region is
now?

Hope this helps
Jay


Quote:
> How do I get the region of a UserControl ?
> Control class has a property Region but its always empty.

> I need the region so that I can rotate my control, is this possible?
> Thanks in advance



Sat, 29 May 2004 09:24:18 GMT  
 getting the region of a usercontrol ? (for rotation)



Quote:
> When you are painting your UserControl, how do you know what the region is
> now?

I use Me.Size.*

Is it possible to rotate a control ? my guess is that if I rotate the region
then the control will rotate, but is this possible ?



Sat, 29 May 2004 09:32:10 GMT  
 getting the region of a usercontrol ? (for rotation)
Eduardo,
If you want to set the control's Region use something like:

    Me.Region = New Region(Me.Bounds)

I'm not sure how you are thinking you can rotate the control with that... I
have never tried... Generally the Region is used to clip the control. To
make a Round control for example...

Rotating the controls means so many things depending on what type of control
you have!

Is it a purely paint yourself control? Then you can Rotate it using:
    Graphics.RotateTransform

You might need to use:
    Graphics.TranslateTransform

first so all your coordinates are 'centered'.

In your Paint Event.

If your control is comprised of other controls, a composite control, I'm not
sure what to suggest...

Hope this helps
Jay


Quote:


message

> > When you are painting your UserControl, how do you know what the region
is
> > now?

> I use Me.Size.*

> Is it possible to rotate a control ? my guess is that if I rotate the
region
> then the control will rotate, but is this possible ?



Sat, 29 May 2004 11:54:28 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Region UserControl...

2. Getting Handle to a region [GDI with VB]

3. Getting a region from a bitmap Solved

4. Getting region from a mask

5. #Region #End Region (code folding)?

6. Parent UserControl's Properties in a UserControl (placed on another UserControl)

7. Getting text from UserControl in VB?

8. Getting a reference to a form's objects from UserControl (OCX)

9. Getting Forms handle In UserControl(ocx) from an application

10. Getting reference to UserControl

11. Usercontrol - Gets disabled with hash marks on rename

12. Getting a Reference to the UserControl Object

 

 
Powered by phpBB® Forum Software