12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.ComponentModel;
- namespace LYFZ.ComponentLibrary
- {
- public class ShowNumber : System.Windows.Forms.Panel
- {
- public ShowNumber()
- {
- this.BackgroundImage = LYFZ.ComponentLibrary.GetUIResources._1_01;
- this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
- this.Width = 27;
- this.Height = 26;
- this.BackColor = System.Drawing.Color.Transparent;
- }
- int number = 1;
- /// <summary>
- ///
- /// </summary>
- [DescriptionAttribute("设置当前显示数字1-10"), CategoryAttribute("组件扩展属性")]
- public int Number
- {
- get { return number; }
- set
- {
- if (value >= 0 && value <= 10)
- {
- number = value;
- switch (Number)
- {
- case 1:
- this.BackgroundImage = LYFZ.ComponentLibrary.GetUIResources._1_01;
- break;
- case 2:
- this.BackgroundImage = LYFZ.ComponentLibrary.GetUIResources._2_01;
- break;
- case 3:
- this.BackgroundImage = LYFZ.ComponentLibrary.GetUIResources._3_01;
- break;
- case 4:
- this.BackgroundImage = LYFZ.ComponentLibrary.GetUIResources._4_01;
- break;
- case 5:
- this.BackgroundImage = LYFZ.ComponentLibrary.GetUIResources._5_01;
- break;
- case 6:
- this.BackgroundImage = LYFZ.ComponentLibrary.GetUIResources._6_01;
- break;
- case 7:
- this.BackgroundImage = LYFZ.ComponentLibrary.GetUIResources._7_01;
- break;
- case 8:
- this.BackgroundImage = LYFZ.ComponentLibrary.GetUIResources._8_01;
- break;
- case 9:
- this.BackgroundImage = LYFZ.ComponentLibrary.GetUIResources._9_01;
- break;
- case 10:
- this.BackgroundImage = LYFZ.ComponentLibrary.GetUIResources._10_01;
- break;
- }
- Invalidate(false);
- }
- }
- }
- }
- }
|