Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Aug 3rd, 2005, 10:58 PM   #1
Wraith Daquell
Programmer
 
Join Date: Feb 2005
Location: Limbo
Posts: 39
Rep Power: 0 Wraith Daquell is on a distinguished road
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
Wraith Daquell is offline   Reply With Quote
Old Aug 23rd, 2005, 1:56 PM   #2
Rory
Expert Programmer
 
Rory's Avatar
 
Join Date: Jan 2005
Location: London
Posts: 542
Rep Power: 4 Rory is on a distinguished road
Send a message via MSN to Rory
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.
Rory is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 1:09 AM.

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