<Page x:Class="WpfBrowserApplication1.Page1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
xmlns:local="clr-namespace:WpfBrowserApplication1"
d:DesignHeight="700" d:DesignWidth="1000"
Title="Page1">
</Page>
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using System.Data;
namespace WpfBrowserApplication1
{
/// <summary>
/// Page1.xaml 的交互逻辑
/// </summary>
public partial class Page1 : Page
{
DrawingVisual dv = new DrawingVisual();
DataTable dt = new DataTable();
public Page1()
{
this.VisualEdgeMode = EdgeMode.Aliased;
dt.Columns.Add("A", typeof(int));
dt.Columns.Add("B", typeof(DateTime));
for (int i = 0; i < 60; i++)
{
DataRow dr = dt.NewRow();
dr[0] = i;
dr[1] = DateTime.Now.AddDays(-14).AddDays(i % 31);
dt.Rows.Add(dr);
}
dt.AcceptChanges();
InitializeComponent();
Pen blackp = new Pen(Brushes.Black, 1);
System.Globalization.CultureInfo ci = new System.Globalization.CultureInfo("zh-cn");
FlowDirection fd = FlowDirection.LeftToRight;
Typeface tf = new Typeface("宋体");
double d = 12;
using (DrawingContext dc = dv.RenderOpen())
{
for (int i = 0; i < 5; i++)
{
dc.DrawRectangle(null, blackp, new Rect(217 * i, 0, 217, 30));
dc.DrawText(new FormattedText("第" + (i + 1).ToString() + "周", ci, fd, tf, d, Brushes.Black), new Point(217 * i + 70, 10));
}
for (int i = 0; i < 35; i++)
dc.DrawRectangle(null, blackp, new Rect(31 * i, 30, 31, 30));
int w = new DateTime(2011, 3, 1).DayOfWeek.GetHashCode();
for(int i = w;i<w + 31;i++)
dc.DrawText(new FormattedText((i - w + 1).ToString(), ci, fd, tf, d, Brushes.Black), new Point(31 * i + 5, 40));
for (int i = 0; i < 35; i++)
dc.DrawRectangle(null, blackp, new Rect(31 * i, 60, 31, 60));
for (int i = 0; i < dt.Rows.Count; i++)
{
int week = ((DateTime)dt.Rows[i][1]).DayOfWeek.GetHashCode();
int day = ((DateTime)dt.Rows[i][1]).Day;
string s = dt.Rows[i][0].ToString();
double left = (double)(week + (day + week / 7 * 7 + 1) * 31 + 5);
double top = i > 30 ? 100 : 70;
dc.DrawText(new FormattedText(s, ci, fd, tf, d, Brushes.Black), new Point(left, top));
}
}
}
protected override int VisualChildrenCount
{
get
{
return 1;
}
}
protected override Visual GetVisualChild(int index)
{
return dv;
}
}
}
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="350" Width="625">
在网上搜索wpf合并单元格,一直没搜索到,没办法,只能自己想办法搞定了。其实就是DataGrid套DataGrid,为了方便支持Column拖动,在合并的DataGridColumn那一列的Header也放一个DataGrid,但是合并的这一个连续列中...
在网上搜索wpf合并单元格,一直没搜索到,没办法,只能自己想办法搞定了。其实就是DataGrid套DataGrid,为了方便支持Column拖动,在合并的DataGridColumn那一列的Header也放一个DataGrid,但是合并的这一个连续列中...
大家好,我是小小张,这是人生20年的第一次博客,写的不好请大家指正,并且因为是工作时间很短,可能未必有大家理解的深刻,有什么问题欢迎大家指正...不开玩笑,方法是很简单的,在datagrid的列中,重写这一列的模...
1. function mergeCells(data){ ... var arr =[{mergeFiled:"departname",premiseFiled:"departname"}, //合并列的field数组及对应前提条件filed(为空则直接内容合并) {mergeFiled:"plancode",premiseFiled:"pla
有时,我们要把一列中内容相同的单元格合并起来。如下图: 此主题相关图片如下:合并后的效果图: 此主题相关图片如下:下面就说说怎么实现的: Sub SpanGrid() Dim i As Integer Dim j As Integer Dim int...
有时,我们要把一列中内容相同的单元格合并起来。如下图: 此主题相关图片如下:合并后的效果图: 此主题相关图片如下:下面就说说怎么实现的: Sub SpanGrid() Dim i As Integer Dim j As Integer Dim int...
合并datagrid中内容相同的单元格 (转)[@more@]有时,我们要把一列中内容相同的单元格合并起来。如下图: 合并后的效果图: 下面就说说怎么实现的: Sub SpanGrid() Dim i As ...
一,引言工作的需要,做了3年的wpf(mvvm)……,又因为项目的需求,回归到web的开发。■3 years ago,vue是我三年前没用过的玩意儿。■ 3 years ago,bootstrap组件没现在成熟。■ 3 years ago,font awesome的普及度...
工作的需要,做了3年的wpf(mvvm)……,又因为项目的需求,回归到web的开发。 ■ 3 years ago,vue是我三年前没用过的玩意儿。 ■ 3 years ago,bootstrap组件没现在成熟。 ■ 3 years ago,font awesome...
是新朋友吗?记得先点蓝字“慧聚IT”关注我哦~Stimulsoft Ultimate是用于创建报表和...该产品包括用于WinForms、ASP.NET、.NET Core、JavaScript、WPF、PHP、Java和其他环境的完整工具集。Stimulsoft Reports和Stim...
一、GridView和DataGrid的异同GridView 是 DataGrid的后继控件,在.net framework 2 ...GridView和 DataGrid功能相似,都是在web页面中显示数据源中的数据,将数据源中的一行数据,也就是一条记录,显示为在web页面上输
关于datagrid的打印http://www.chinaaspx.com/article/csharp/295.htmC#中为DataGrid添加下拉列表框http://www.cnblogs.com/icesnaker/archive/2004/09/21/45015.aspxDataGrid也玩分页...
Silverlight/Windows8/WPF/WP7/HTML5周学习导读(8月5日-8月12日)本周Silverlight学习资源更新Silverlight设计时特性的使用_eagleSilverlight 学习——重写DatePicker (二)happychbSilverlight ItemTemplate和...
控件分类:DataGridView 控件DataGridView 控件:提供用来显示...使用 DataGridView 类,可以自定义单元格、行、列和边框。注意:DataGridView控件提供 DataGrid 控件所不具备的许多基本和高级功能。有关更多信息,请参
网址:http://www.codeplex.com/说明: CodePlex is Microsoft's open source project hosting web site. Start a new project, join an existing one, or download software created by the community.ASP.NET数据...
ApplicationsCrafting a C# forms Editor From scratchhttp://www.codeproject.com/csharp/SharpFormEditorDemo.asp建立一个类似C#的环境, 实现控件拖拉,属性 Packet Capture and Analayzer网络封包截获...
第四篇 REST API开发篇
网站开发的完整流程 网站页面设计的方法 网站开发的步骤 开发之前的准备 静态页面设计工具 一般程序员:Dreamweaver、VS、VS Code、HBuilder、EditPlus… 大牛、二逼:txt文本文档 需要的浏览器 IE8之后系列、火狐...
一直在网上找资料来弄个固定表头的东西 有时也想根据有字段来对数据进行分组。...这些问题在财务系统中经常遇到相比在其他行业也有类似情况,今天下午整理了下资料,来出来和大家分享。 效果图1: 效果图2 :
开发在Windows 7操作系统上运行的客户端应用程序时,建议用 WPF 应用程序来实现,这样可以充分发挥GPU硬件加速的性能优势。 2016-06-28 .NET框架包括两个主要组件,一个是公共语言运行库(Common Language ...
网站开发的步骤 开发之前的准备 静态页面设计工具 需要的浏览器 服务器应用程序开发环境 数据库开发环境 网页开发的模块 浏览器价值 HTML HTML5的基本结构 标签(标记) 标签的分类 标签的属性 标签的...
关键字过滤 技巧:使用User Control做HTML生成 仿163网盘无刷新文件上传系统 跨服务器文件上传解决方案 Disable anchor tag的javascript代码(兼容IE和Fire...WebBrowser加载完毕后再往下...
本词汇表定义了 Visual Studio 2008 和 .NET Framework 中的关键术语。.NET Compact Framework一种独立于硬件的环境,用于在资源受限制的计算设备上运行程序。它继承了公共语言运行库的完整 .NET Framework 结构,...
带你学习TCP控制以及通信 学习网络的概念以及含义
使用java编写的,可以将电脑端微信的dat加密文件转换为png、jpg等图片资源,方便直接查看微信聊天记录文件。
Python实现自动化办公视频教程:Excel处理、PDF转换、Word和PPT自动生成、Web自动处理。
个人简历大全,满足各行业需求,可以根据自己实际情况任意进行修改。
优质简历模板,目前最前全的模板收藏,需要换工作的小伙伴们可以试试
2020华为软件精英挑战赛初复赛赛题包,不包含民间数据集,民间数据集在博客中给出大佬github地址。