• 大小: 95KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-05-16
  • 语言: C#
  • 标签: C#  透明  背景  的垂直  

资源简介

C# 透明 背景 的垂直 Label控件C# 透明 背景 的垂直 Label控件C# 透明 背景 的垂直 Label控件C# 透明 背景 的垂直 Label控件C# 透明 背景 的垂直 Label控件

资源截图

代码片段和文件信息

using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;

namespace randz.CustomControls
{
    /// 
    /// A custom windows control to display text vertically
    /// 

    [ToolboxBitmap(typeof(VerticalLabel) “VerticalLabel.ico“)]
    public class VerticalLabel : System.Windows.Forms.Control
    {
        private string labelText;
        private DrawMode _dm = DrawMode.BottomUp;
        private bool _transparentBG = false;
        System.Drawing.Text.TextRenderingHint _renderMode = System.Drawing.Text.TextRenderingHint.SystemDefault;

        private System.ComponentModel.Container components = new System.ComponentModel.Container();

        /// 
        /// VerticalLabel constructor
        /// 

        public VerticalLabel()
        {
            base.CreateControl();
            InitializeComponent();
            Setstyle(System.Windows.Forms.Controlstyles.Opaque true);
        }

        /// 
        /// Dispose override method
        /// 

        /// boolean parameter
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (!((components == null)))
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        [System.Diagnostics.DebuggerStepThrough()]
        private void InitializeComponent()
        {
            this.Size = new System.Drawing.Size(24 100);
        }

        /// 
        /// OnPaint override. This is where the text is rendered vertically.
        /// 

        /// PaintEventArgs
        protected override void OnPaint(System.Windows.Forms.PaintEventArgs e)
        {
            float vlblControlWidth;
            float vlblControlHeight;
            float vlblTransformX;
            float vlblTransformY;

            Color controlBackColor = BackColor;
            Pen labelBorderPen;
            SolidBrush labelBackColorBrush;

            if (_transparentBG)
            {
                labelBorderPen = new Pen(Color.Empty 0);
                labelBackColorBrush = new SolidBrush(Color.Empty);
            }
            else
            {
                labelBorderPen = new Pen(controlBackColor 0);
                labelBackColorBrush = new SolidBrush(controlBackColor);
            }
            
            SolidBrush labelForeColorBrush = new SolidBrush(base.ForeColor);
            base.OnPaint(e);
            vlblControlWidth = this.Size.Width;
            vlblControlHeight = this.Size.Height;
            e.Graphics.DrawRectangle(labelBorderPen 0 0 vlblControlWidth vlblControlHeight);
            e.Graphics.FillRectangle(labelBackColorBrush 0 0 vlblControlWidth vlblControlHeight);
            e.Graphics.

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件      20480  2007-09-27 11:37  C# 透明背景的垂直Label控件\VerticalLabel\bin\Release\VerticalLabel.dll

     文件       2270  2007-09-27 11:37  C# 透明背景的垂直Label控件\VerticalLabel\bin\Release\VerticalLabel.xml

     文件        604  2009-01-31 19:44  C# 透明背景的垂直Label控件\VerticalLabel\obj\Debug\VerticalLabel.csproj.FileListAbsolute.txt

     文件       7680  2009-01-31 19:44  C# 透明背景的垂直Label控件\VerticalLabel\obj\Debug\VerticalLabel.dll

     文件      15872  2009-01-31 19:44  C# 透明背景的垂直Label控件\VerticalLabel\obj\Debug\VerticalLabel.pdb

     文件       1353  2007-09-27 10:56  C# 透明背景的垂直Label控件\VerticalLabel\Properties\AssemblyInfo.cs

     文件        115  2007-09-27 11:36  C# 透明背景的垂直Label控件\VerticalLabel\readme.txt

     文件       6121  2007-09-27 11:37  C# 透明背景的垂直Label控件\VerticalLabel\VerticalLabel.cs

     文件       2697  2009-01-31 19:44  C# 透明背景的垂直Label控件\VerticalLabel\VerticalLabel.csproj

     文件        915  2009-01-31 19:44  C# 透明背景的垂直Label控件\VerticalLabel\VerticalLabel.sln

    ..A..H.     10240  2009-01-31 19:44  C# 透明背景的垂直Label控件\VerticalLabel\VerticalLabel.suo

     文件      20480  2007-09-27 11:37  C# 透明背景的垂直Label控件\VerticalLabelDemo_110_source\VerticalLabelDemo\bin\Debug\VerticalLabel.dll

     文件       9216  2009-01-31 19:46  C# 透明背景的垂直Label控件\VerticalLabelDemo_110_source\VerticalLabelDemo\bin\Debug\VerticalLabelDemo.exe

     文件      22016  2009-01-31 19:46  C# 透明背景的垂直Label控件\VerticalLabelDemo_110_source\VerticalLabelDemo\bin\Debug\VerticalLabelDemo.pdb

     文件      14328  2009-01-31 19:46  C# 透明背景的垂直Label控件\VerticalLabelDemo_110_source\VerticalLabelDemo\bin\Debug\VerticalLabelDemo.vshost.exe

     文件        490  2007-07-21 01:33  C# 透明背景的垂直Label控件\VerticalLabelDemo_110_source\VerticalLabelDemo\bin\Debug\VerticalLabelDemo.vshost.exe.manifest

     文件      20480  2007-09-27 11:37  C# 透明背景的垂直Label控件\VerticalLabelDemo_110_source\VerticalLabelDemo\bin\Release\VerticalLabel.dll

     文件       2270  2007-09-27 11:37  C# 透明背景的垂直Label控件\VerticalLabelDemo_110_source\VerticalLabelDemo\bin\Release\VerticalLabel.xml

     文件      20480  2007-09-27 11:38  C# 透明背景的垂直Label控件\VerticalLabelDemo_110_source\VerticalLabelDemo\bin\Release\VerticalLabelDemo.exe

     文件        342  2007-09-27 11:27  C# 透明背景的垂直Label控件\VerticalLabelDemo_110_source\VerticalLabelDemo\Form1.cs

     文件       5657  2007-09-27 11:27  C# 透明背景的垂直Label控件\VerticalLabelDemo_110_source\VerticalLabelDemo\Form1.Designer.cs

     文件       5814  2007-09-27 11:27  C# 透明背景的垂直Label控件\VerticalLabelDemo_110_source\VerticalLabelDemo\Form1.resx

     文件       4494  2009-01-31 19:46  C# 透明背景的垂直Label控件\VerticalLabelDemo_110_source\VerticalLabelDemo\obj\Debug\ResolveAssemblyReference.cache

     文件       4608  2009-01-31 19:43  C# 透明背景的垂直Label控件\VerticalLabelDemo_110_source\VerticalLabelDemo\obj\Debug\TempPE\Properties.Resources.Designer.cs.dll

     文件       1234  2009-01-31 19:46  C# 透明背景的垂直Label控件\VerticalLabelDemo_110_source\VerticalLabelDemo\obj\Debug\VerticalLabelDemo.csproj.FileListAbsolute.txt

     文件        847  2009-01-31 19:45  C# 透明背景的垂直Label控件\VerticalLabelDemo_110_source\VerticalLabelDemo\obj\Debug\VerticalLabelDemo.csproj.GenerateResource.Cache

     文件       9216  2009-01-31 19:46  C# 透明背景的垂直Label控件\VerticalLabelDemo_110_source\VerticalLabelDemo\obj\Debug\VerticalLabelDemo.exe

     文件        180  2009-01-31 19:46  C# 透明背景的垂直Label控件\VerticalLabelDemo_110_source\VerticalLabelDemo\obj\Debug\VerticalLabelDemo.Form1.resources

     文件      22016  2009-01-31 19:46  C# 透明背景的垂直Label控件\VerticalLabelDemo_110_source\VerticalLabelDemo\obj\Debug\VerticalLabelDemo.pdb

     文件        180  2009-01-31 19:46  C# 透明背景的垂直Label控件\VerticalLabelDemo_110_source\VerticalLabelDemo\obj\Debug\VerticalLabelDemo.Properties.Resources.resources

............此处省略32个文件信息

评论

共有 条评论