• 大小: 47.75 KB
    文件类型: .rar
    金币: 2
    下载: 0 次
    发布日期: 2024-08-05
  • 语言: 其他
  • 标签: 1  

资源简介

DataGridView财务金额格式显示

资源截图

代码片段和文件信息

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

namespace WindowsApplication37
{
    public class FinanceTextBoxCell : DataGridViewTextBoxCell
    {
        /// 
        /// 线间隔大小
        /// 

        private int m_iLineSpace ;
        /// 
        /// 线粗
        /// 

        private float m_fBold ;

        /// 
        /// 红线颜色,特殊占位颜色,普通线颜色
        /// 

        private Color m_redColor;

        private Color m_specialColor;

        private Color m_normalColor;


        public FinanceTextBoxCell()
        {
            m_iLineSpace = 12;
            m_fBold = 1.0f;
            m_redColor = Color.Red;
            m_specialColor = Color.Blue;
            m_normalColor = Color.Gray;

        }
        /// 
        /// 线间距
        /// 

        public int LineSpace
        {
            set
            {
                m_iLineSpace = value;
                
            }
            get
            {
                FinanceTextBoxColumn financeTextBoxColumn= OwningColumn as FinanceTextBoxColumn;
                if (financeTextBoxColumn != null)
                {
                    if (financeTextBoxColumn.LineSpace != 0)
                    {
                        return financeTextBoxColumn.LineSpace;
                    }
                }
                return m_iLineSpace;
            }
        }
        public float LineBold
        {
            get
            {
                FinanceTextBoxColumn financeTextBoxColumn = OwningColumn as FinanceTextBoxColumn;
                if (financeTextBoxColumn != null)
                {
                    if (financeTextBoxColumn.LineBold != 0.0f)
                    {
                        return financeTextBoxColumn.LineBold;
                    }
                }
                return m_fBold;
            }
            set
            {
                m_fBold = value;
            }
        }
        public Color RedColor
        {
            get
            {
                FinanceTextBoxColumn financeTextBoxColumn = OwningColumn as FinanceTextBoxColumn;
                if (financeTextBoxColumn != null)
                {
                    if (financeTextBoxColumn.RedColor != Color.Empty)
                    {
                        return financeTextBoxColumn.RedColor;
                    }
                }
                return m_redColor;
            }
            set
            {
                m_redColor = value;
            }
        }
        public Color SpecialColor
        {
            get
            {
                FinanceTextBoxColumn financeTextBoxColumn = OwningColumn as FinanceTextBoxColumn;
                if (financeTextBoxColumn != null)

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

     文件       5612  2006-01-11 19:21  WindowsApplication37\WindowsApplication37\Properties\Resources.resx

     文件        249  2006-01-11 19:21  WindowsApplication37\WindowsApplication37\Properties\Settings.settings

     文件       1288  2006-01-11 19:21  WindowsApplication37\WindowsApplication37\Properties\AssemblyInfo.cs

     文件       2867  2006-01-11 19:21  WindowsApplication37\WindowsApplication37\Properties\Resources.Designer.cs

     文件       1103  2006-01-11 19:21  WindowsApplication37\WindowsApplication37\Properties\Settings.Designer.cs

     目录          0  2006-01-11 19:21  WindowsApplication37\WindowsApplication37\Properties

     文件      11081  2006-01-12 12:57  WindowsApplication37\WindowsApplication37\FinanceTextBoxCell.cs

     文件        694  2006-01-12 12:49  WindowsApplication37\WindowsApplication37\Form1.cs

     文件       3375  2006-01-11 20:33  WindowsApplication37\WindowsApplication37\WindowsApplication37.csproj

     文件       5632  2005-08-31 04:07  WindowsApplication37\WindowsApplication37\bin\Debug\WindowsApplication37.vshost.exe

     文件      28672  2006-01-12 12:57  WindowsApplication37\WindowsApplication37\bin\Debug\WindowsApplication37.exe

     文件      46592  2006-01-12 12:57  WindowsApplication37\WindowsApplication37\bin\Debug\WindowsApplication37.pdb

     目录          0  2006-01-11 19:21  WindowsApplication37\WindowsApplication37\bin\Debug

     目录          0  2006-01-11 19:21  WindowsApplication37\WindowsApplication37\bin

     目录          0  2006-01-11 19:21  WindowsApplication37\WindowsApplication37\obj\Debug\TempPE

     文件        180  2006-01-12 12:49  WindowsApplication37\WindowsApplication37\obj\Debug\WindowsApplication37.Form1.resources

     文件        180  2006-01-11 19:24  WindowsApplication37\WindowsApplication37\obj\Debug\WindowsApplication37.Properties.Resources.resources

     文件      46592  2006-01-12 12:57  WindowsApplication37\WindowsApplication37\obj\Debug\WindowsApplication37.pdb

     文件        842  2006-01-12 12:49  WindowsApplication37\WindowsApplication37\obj\Debug\WindowsApplication37.csproj.GenerateResource.Cache

     文件      28672  2006-01-12 12:57  WindowsApplication37\WindowsApplication37\obj\Debug\WindowsApplication37.exe

     目录          0  2006-01-11 19:27  WindowsApplication37\WindowsApplication37\obj\Debug\Refactor

     目录          0  2006-01-11 19:21  WindowsApplication37\WindowsApplication37\obj\Debug

     文件        359  2006-01-12 12:57  WindowsApplication37\WindowsApplication37\obj\WindowsApplication37.csproj.FileList.txt

     目录          0  2006-01-11 19:21  WindowsApplication37\WindowsApplication37\obj

     文件       7499  2006-01-12 12:30  WindowsApplication37\WindowsApplication37\FinanceTextBoxColumn.cs

     文件       4601  2006-01-12 12:46  WindowsApplication37\WindowsApplication37\Form1.Designer.cs

     文件       6366  2006-01-12 12:46  WindowsApplication37\WindowsApplication37\Form1.resx

     文件        487  2006-01-11 19:21  WindowsApplication37\WindowsApplication37\Program.cs

     目录          0  2006-01-11 19:21  WindowsApplication37\WindowsApplication37

     文件        949  2006-01-11 19:21  WindowsApplication37\WindowsApplication37.sln

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

评论

共有 条评论