Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   Visual Basic .NET (http://www.programmingforums.org/forum19.html)
-   -   Regions/GraphicsPath (http://www.programmingforums.org/showthread.php?t=5245)

Wraith Daquell Aug 3rd, 2005 11:58 PM

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)

Rory Aug 23rd, 2005 2:56 PM

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.


All times are GMT -5. The time now is 8:35 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC