2011-12-17 05:22:40 -04:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.ComponentModel;
|
|
|
|
|
using System.Drawing;
|
|
|
|
|
using System.Data;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
|
2012-04-24 10:49:27 -03:00
|
|
|
|
namespace ArdupilotMega.Controls
|
2011-12-17 05:22:40 -04:00
|
|
|
|
{
|
2012-02-20 07:30:47 -04:00
|
|
|
|
public partial class ImageLabel : UserControl //ContainerControl
|
2011-12-17 05:22:40 -04:00
|
|
|
|
{
|
|
|
|
|
public new event EventHandler Click;
|
|
|
|
|
|
|
|
|
|
private Image picture;
|
|
|
|
|
private string text;
|
|
|
|
|
|
|
|
|
|
public ImageLabel()
|
|
|
|
|
{
|
2012-02-20 07:30:47 -04:00
|
|
|
|
text = "";
|
|
|
|
|
picture = new Bitmap(640,480);
|
|
|
|
|
|
2011-12-17 05:22:40 -04:00
|
|
|
|
InitializeComponent();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setImageandText(Image image, string text)
|
|
|
|
|
{
|
|
|
|
|
pictureBox1.Image = image;
|
|
|
|
|
label1.Text = text;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[System.ComponentModel.Browsable(true)]
|
|
|
|
|
public Image Image {
|
|
|
|
|
get { return picture; }
|
|
|
|
|
set { picture = value; pictureBox1.Image = picture; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[System.ComponentModel.Browsable(true)]
|
|
|
|
|
public override string Text
|
|
|
|
|
{
|
|
|
|
|
get { return text; }
|
|
|
|
|
set { text = value; label1.Text = text; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void pictureBox1_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
if (Click != null)
|
|
|
|
|
{
|
|
|
|
|
Click(sender,new EventArgs());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|