home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / os / mswindo / programm / tools / 1943 < prev    next >
Encoding:
Internet Message Format  |  1993-01-08  |  1.8 KB

  1. From: galenr@hpgrla.gr.hp.com (Galen Raben)
  2. Date: Fri, 8 Jan 1993 16:28:16 GMT
  3. Subject: VB 2.0 - using the clipboard?
  4. Message-ID: <54540005@hpgrla.gr.hp.com>
  5. Organization: Hewlett-Packard, Greeley, CO
  6. Path: sparky!uunet!zaphod.mps.ohio-state.edu!usc!sdd.hp.com!hpscit.sc.hp.com!hplextra!hpfcso!hpgrla!galenr
  7. Newsgroups: comp.os.ms-windows.programmer.tools
  8. Lines: 39
  9.  
  10.  
  11. Another question, this time with copying things to the clipboard with VB 2.0...
  12.  
  13. On my form I have a picture control "Pic1" with a control array of image 
  14. controls within "MyIcons()".  Pic1 has a background bmp loaded and each
  15. image control of the MyIcons control array have individual icon loaded.
  16. The individual MyIcons controls are moved around at runtime by the program.
  17.  
  18. What I am trying to do is copy the resulting graphic to the clipboard.
  19. Problem is I can't get the image controls to copy as well.
  20.  
  21. Sub mnuCopy_Click
  22.    Clipboard.Clear
  23.    Clipboard.Setdata  ActiveForm.Pic1.Picture
  24. End Sub
  25.  
  26. Gets the background bitmap ok but no image control icons (note: this is an
  27. MDI child window - is why I use ActiveForm...  shouldn't make a difference
  28. for purposes of what I'm asking though)
  29.  
  30. I also tried 
  31.    Clipboard.Setdata ActiveForm.MyIcon(I%).picture  (with a for/next loop)
  32. and
  33.    Clipboard.Setdata ActiveControl.picture
  34. but VB says that the format is invalid in the first case and grabs 
  35. the background bitmap in the second case...
  36.  
  37. What Gives???
  38.  
  39. Does the clipboard object require that the image I'm trying to grab come
  40. from an object with an autorefresh property?  (Image controls don't have
  41. an autorefresh property).  I can't find any references in the manual or
  42. online help on copying image controls.... (just some stuff in the chapter
  43. on printing that suggests autorefresh must be true to print graphics...)
  44.  
  45. Thanks again!!!!!
  46. - Galen -
  47. galenr@hpgrla.gr.hp.com
  48.  
  49.