2
Reply

How to find an assembly reference

Khoi

Khoi

Nov 21 2009 12:48 PM
5.3k
I have developed a code which copy and paste text and an image, but .net says this code is missing an assembly reference. I don't know how to find that reference. Please advise

Below is my code

============================
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace Clipboard
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void btnCopytext_Click(object sender, EventArgs e)
        {
            Clipboard.SetText(txtClipboard.Text);
        }

        private void btnPastetext_Click(object sender, EventArgs e)
        {
            txtClipboard.Text = Clipboard.GetText();
        }

        private void btnCopyimg_Click(object sender, EventArgs e)
        {
            if (opnImage.ShowDialog() == DialogResult.OK)
            {
                Image imgtoCopy = Image.FromFile(opnImage.FileName);
                Clipboard.SetImage(imgtoCopy);
            }
        }

        private void btnPasteimg_Click(object sender, EventArgs e)
        {
            picClipBoard.Image = Clipboard.GetImage();
        }

        private void btnClearClipboard_Click(object sender, EventArgs e)
        {
            Clipboard.Clear();
        }

    }
}
=========================

Answers (2)