Loading the Clipboard in .Net (i.e. how to what I used to do in VB6?)

  • Thread starter Thread starter T-Man
  • Start date Start date
T

T-Man

Hey All,

In VB6, one could the following:

VB.Clipboard.SetData frmSubmit.picToolbarIcon.Image

or

LoadPicture(App.Path & MY_PIC_PATH)

I've tried the following but it does not work:

Clipboard.SetDataObject(MyApp.frmSubmit.ActiveForm.Icon.ToBitmap());

Does anyone know how to do this in .Net?

Thanks & Regards,

TC
 
T-Man said:
Clipboard.SetDataObject(MyApp.frmSubmit.ActiveForm.Icon.ToBitmap());

Does anyone know how to do this in .Net?

Mhm... Try this:

\\\
Dim img As Image = Image.FromFile("C:\camera.bmp")
Clipboard.SetDataObject(img, True)
....
///
 
Hey Herfried,

I just realized my folly!

The below works fine:

Clipboard.SetDataObject(MyApp.frmSubmit.ActiveForm.Icon.ToBitmap());

if one instantiates an instance of the form first!

MyApp.frmSubmit MyForm=new MyApp.frmSubmit();
Clipboard.SetDataObject(MyForm.Icon.ToBitmap());

Like the saying goes "Brain on vacation... please call back later."

Thanks for the assistance. Looking at your code jogged my memory.

I just haven't adjusted to the meanings of the new error messages under
..Net.

Regards,

TC


The problem is that my image is actually
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top