🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.ms-windows.programmer.tools
Article #881

VB 2.0 - using the clipboard?

#881
From: Galen Raben
Date: Fri, 08 Jan 1993 16:28
38 lines
1887 bytes
Another question, this time with copying things to the clipboard with VB 2.0...

On my form I have a picture control "Pic1" with a control array of image 
controls within "MyIcons()".  Pic1 has a background bmp loaded and each
image control of the MyIcons control array have individual icon loaded.
The individual MyIcons controls are moved around at runtime by the program.

What I am trying to do is copy the resulting graphic to the clipboard.
Problem is I can't get the image controls to copy as well.

Sub mnuCopy_Click
   Clipboard.Clear
   Clipboard.Setdata  ActiveForm.Pic1.Picture
End Sub

Gets the background bitmap ok but no image control icons (note: this is an
MDI child window - is why I use ActiveForm...  shouldn't make a difference
for purposes of what I'm asking though)

I also tried 
   Clipboard.Setdata ActiveForm.MyIcon(I%).picture  (with a for/next loop)
and
   Clipboard.Setdata ActiveControl.picture
but VB says that the format is invalid in the first case and grabs 
the background bitmap in the second case...

What Gives???

Does the clipboard object require that the image I'm trying to grab come
from an object with an autorefresh property?  (Image controls don't have
an autorefresh property).  I can't find any references in the manual or
online help on copying image controls.... (just some stuff in the chapter
on printing that suggests autorefresh must be true to print graphics...)

Thanks again!!!!!
- Galen -
galenr@hpgrla.gr.hp.com
Technical Details
Message-ID: <54540005@hpgrla.gr.hp.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!usc!sdd.hp.com!hpscit.sc.hp.com!hplextra!hpfcso!hpgrla!galenr

Show Full Headers
Complete Article Headers
From: galenr@hpgrla.gr.hp.com (Galen Raben)
Date: Fri, 8 Jan 1993 16:28:16 GMT
Subject: VB 2.0 - using the clipboard?
Message-ID: <54540005@hpgrla.gr.hp.com>
Organization: Hewlett-Packard, Greeley, CO
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!usc!sdd.hp.com!hpscit.sc.hp.com!hplextra!hpfcso!hpgrla!galenr
Newsgroups: comp.os.ms-windows.programmer.tools
Lines: 39