77 lines
2.2 KiB
C#
77 lines
2.2 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Data;
|
|
using System.Drawing;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Windows.Forms;
|
|
|
|
namespace TestShapeControl
|
|
{
|
|
public partial class Form6 : Form
|
|
{
|
|
public Form6()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
private void radioButtonCheckedChanged(object sender, EventArgs e)
|
|
{
|
|
|
|
object o=null;
|
|
object c1 = null;
|
|
object c2 = null;
|
|
|
|
if (!((RadioButton)sender).Checked) return;
|
|
|
|
switch (((RadioButton )sender).Name)
|
|
{
|
|
|
|
case "radioButtonNone":
|
|
|
|
ctrlButterfly.BackgroundImage = null;
|
|
ctrlButterfly.ShapeImageTexture = null;
|
|
|
|
ctrlPlane.BackgroundImage = null;
|
|
ctrlPlane.ShapeImageTexture = null;
|
|
ctrlButterfly.Refresh();
|
|
break;
|
|
|
|
case "radioButtonBG" :
|
|
|
|
o = global::TestShapeControl.Properties.Resources.ResourceManager.GetObject("silverbricks");
|
|
|
|
ctrlButterfly.ShapeImageTexture = null;
|
|
ctrlButterfly.BackgroundImage = (Bitmap)o;
|
|
|
|
ctrlPlane.ShapeImageTexture = null;
|
|
ctrlPlane.BackgroundImage = (Bitmap)o;
|
|
break;
|
|
|
|
|
|
case "radioButtonTexture":
|
|
|
|
o = global::TestShapeControl.Properties.Resources.ResourceManager.GetObject("silverbricks");
|
|
|
|
ctrlButterfly.ShapeImageTexture = (Bitmap)o;
|
|
ctrlPlane.ShapeImageTexture = (Bitmap)o;
|
|
|
|
break;
|
|
|
|
case "radioButtonCustomTexture":
|
|
|
|
c1 = global::TestShapeControl.Properties.Resources.ResourceManager.GetObject("butterflyColor");
|
|
c2 = global::TestShapeControl.Properties.Resources.ResourceManager.GetObject("plane4Color");
|
|
|
|
ctrlButterfly.ShapeImageTexture = (Bitmap) c1;
|
|
ctrlPlane.ShapeImageTexture = (Bitmap) c2;
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|