Go Back   Forum Care Forums > Development Reference Area > Visual Basic

Reply
 
LinkBack Thread Tools Display Modes
Saving picturebox usercontrols
Old
  (#1)
Kate
Guest
 
Posts: n/a
Default Saving picturebox usercontrols - 06-04-2007, 08:52 AM

Hi:

I have a picturebox control, and at runtime various usercontrols are
added to it to make a diagram. As dynamically added usercontrols, they
are of type VBExtender.

Is there a way to save the diagram as a .wmf file? (The diagram might
extend beyond the confines of the actual picturebox on the screen.)

I have seen examples of how to print all the controls in a picturebox
(using the sendmessage function), but my usercontrols don't print
using this method. I'm wondering if there is something I can do so
that they are counted as being "owned" or "children" or in the
"clientarea" of the picturebox (the wparam for that sendmessage
function), and if doing so will also enable me to save the diagram as
well as print it.

*in case it makes a difference, the usercontrols themselves are
transparent and not windowless--their "appearance" is as shapes drawn
on them when they are created.

Thanks in advance for any ideas--
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Re: Saving picturebox usercontrols
Old
  (#2)
Randy Birch
Guest
 
Posts: n/a
Default Re: Saving picturebox usercontrols - 06-04-2007, 08:52 AM

You may be able to modify the code at
http://www.mvps.org/vbnet/code/image...metafileps.htm to take a
snapshot of the usercontrol. This demo does the screen because
GetDesktopWindow() is p***ed as the hwnd of interest. It should work if you
instead p*** the hwnd of the usercontrol.

--

Randy Birch
MVP Visual Basic
http://www.mvps.org/vbnet/
Please respond only to the newsgroups so all can benefit.


"Kate" <EMAIL REMOVED> wrote in message
news:EMAIL REMOVED om...
: Hi:
:
: I have a picturebox control, and at runtime various usercontrols are
: added to it to make a diagram. As dynamically added usercontrols, they
: are of type VBExtender.
:
: Is there a way to save the diagram as a .wmf file? (The diagram might
: extend beyond the confines of the actual picturebox on the screen.)
:
: I have seen examples of how to print all the controls in a picturebox
: (using the sendmessage function), but my usercontrols don't print
: using this method. I'm wondering if there is something I can do so
: that they are counted as being "owned" or "children" or in the
: "clientarea" of the picturebox (the wparam for that sendmessage
: function), and if doing so will also enable me to save the diagram as
: well as print it.
:
: *in case it makes a difference, the usercontrols themselves are
: transparent and not windowless--their "appearance" is as shapes drawn
: on them when they are created.
:
: Thanks in advance for any ideas--


   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

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
Trackbacks are On
Pingbacks are On
Refbacks are On





Contact Us - Forum Care Forums - Archive - Top