您现在的位置是:主页 > news > 医院为什么要做门户网站建设/建立网站需要什么条件

医院为什么要做门户网站建设/建立网站需要什么条件

admin2025/6/14 17:16:03news

简介医院为什么要做门户网站建设,建立网站需要什么条件,网站开发环境是什么意思,校园网站开发的需求分析要求: 1,选中行时,不改变行的背景色 ,在行的顶部和底部划线表示 2,当满足条件时,在行的中间划线 下面的例子简单实现这两个要求 /********************************************** * 作 者: DreamDays* * 说 明: DataGridViewDemo:行划线* * 时 间:2012年0…

医院为什么要做门户网站建设,建立网站需要什么条件,网站开发环境是什么意思,校园网站开发的需求分析要求: 1,选中行时,不改变行的背景色 ,在行的顶部和底部划线表示 2,当满足条件时,在行的中间划线 下面的例子简单实现这两个要求 /********************************************** * 作 者: DreamDays* * 说 明: DataGridViewDemo:行划线* * 时 间:2012年0…

要求:

1,选中行时,不改变行的背景色 ,在行的顶部和底部划线表示

2,当满足条件时,在行的中间划线

下面的例子简单实现这两个要求

/********************************************** * 作    者: DreamDays* * 说    明: DataGridViewDemo:行划线* * 时    间:2012年05月01日*********************************************/
using System.Drawing;
using System.Windows.Forms;namespace WinFormDataGridViewDemo
{public partial class Form1 : Form{public Form1(){InitializeComponent();InitData();}int pass = 450;//用来在行中间划线的画笔Pen penMid = new Pen(Color.Red);//选中行时划线的画笔Pen penSelected = new Pen(Color.White);private void dgvResult_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e){Rectangle rec = e.RowBounds;int score = GetNumberByObject(dgvResult.Rows[e.RowIndex].Cells["colResult"].Value);if (!IsPass(score, pass)){//不及格时 ,在行中间划线Point pStart = new Point(rec.X, rec.Y + rec.Height / 2);Point pEnd = new Point(rec.X + rec.Width, rec.Y + rec.Height / 2);e.Graphics.DrawLine(penMid, pStart, pEnd);}if (this.dgvResult.CurrentRow.Index == e.RowIndex){//选中行时划线Point pTopStart = new Point(rec.X, rec.Y + 2);Point pTopEnd = new Point(rec.X + rec.Width, rec.Y + 2);Point pBottomStart = new Point(rec.X, rec.Y + rec.Height - 2);Point pBottomEnd = new Point(rec.X + rec.Width, rec.Y + rec.Height - 2);e.Graphics.DrawLine(penSelected, pTopStart, pTopEnd);e.Graphics.DrawLine(penSelected, pBottomStart, pBottomEnd);}}private void dgvResult_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e){if (this.dgvResult.CurrentRow.Index == e.RowIndex){//选中行时不改变行底色e.CellStyle.SelectionBackColor = e.CellStyle.BackColor;e.FormattingApplied = true;}}/// <summary>/// 添加几行数据/// </summary>private void InitData(){this.dgvResult.Rows.Add(new string[] { "张三", "500" });this.dgvResult.Rows.Add(new string[] { "李四", "451" });this.dgvResult.Rows.Add(new string[] { "王五", "500" });this.dgvResult.Rows.Add(new string[] { "马六", "449" });this.dgvResult.Rows.Add(new string[] { "小明", "410" });this.dgvResult.Rows.Add(new string[] { "小花", "550" });this.dgvResult.Rows.Add(new string[] { "小强", "510" });this.dgvResult.Rows.Add(new string[] { "小小", "500" });this.dgvResult.Rows.Add(new string[] { "大牛", "440" });this.dgvResult.Rows.Add(new string[] { "二虎", "450" });}/// <summary>/// 判断是否达到及格线/// </summary>/// <param name="score"></param>/// <param name="pass"></param>/// <returns></returns>private bool IsPass(int score, int pass){return score >= pass;}/// <summary>/// 将object转换为int/// </summary>/// <param name="o"></param>/// <returns></returns>private int GetNumberByObject(object o){if (o == null){return 0;}int score = 0;int.TryParse(o.ToString(), out score);return score;}}
}

效果图如下:

不及格的行中间划线 ,选中的行用两条白线表示

转载于:https://www.cnblogs.com/DreamDays/archive/2012/05/01/2478080.html