![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Programmer
Join Date: Feb 2005
Location: Limbo
Posts: 39
Rep Power: 0
![]() |
Regions/GraphicsPath
Hello all.
I'm trying to create a Panel that will 'envelope' another control. It's supposed to grow seven pixels from the control's four borders; that I did (easy). However, then, its Region needs to be set so that the middle is transparent so that the control will show through, even if the Panel is in the front of the z-order. In the following code, I should add that the Panel has an added field called Owner, the control that the Panel is surrounding. Dim MyGraph As New GraphicsPath 'Add the rectangle of this instance MyGraph.AddRectangle(New Rectangle(Me.Location, Me.Size)) MyGraph.AddRectangle(New Rectangle(Me.Owner.Location, Me.Owner.Size)) Me.Region = New Region(MyGraph) I've no clue as to why it doesn't work. Anybody think they have a clue? (yes, I know my descriptions and code-posting were less than helpful)
__________________
The meek will inherit the earth. -WDaquell |
|
|
|
|
|
#2 |
|
Expert Programmer
|
Have you given the (unmanaged) API method a shot (i.e. SetWindowRegion et al) - if that fails then it means one or more of the controls isn't actually a window (as in a client/child on the parent window) but simply drawn on the form's device context, in which case you'd need to make it a layered window (EXT_LAYERED) using SetWindowLong. Hope this helps.
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|