2023年12月6日發(fā)(作者:中國(guó)娃娃組合)

C#winFrom自定義gridview樣式制作好看的大屏顯示隊(duì)列
自定義隊(duì)列可以根據(jù)某列自行給予固定的寬度、顏色顯示等。廢話不說(shuō)直接貼代碼。
using System;
using c;
using entModel;
using ;
using g;
using ;
using ;
using pServices;
using ;
using ;
using ;
namespace Call_form
{
public partial class Form1 : Form
{
}
private void Form1_Load(object nder, EventArgs e)
{
rderStyle = ; //設(shè)置窗體為無(wú)邊框樣式
State = zed; //最大化窗體
data_grid_style();//DataGridView 的樣式,當(dāng)datagridview不存在數(shù)據(jù)則報(bào)錯(cuò)
}
#region 給datagridview賦值和設(shè)定樣式
private void data_grid_style() {
//dersVisible = fal;//隱藏標(biāo)題
//HeadersVisible = fal;//隱藏首列
//s[0].Visible = true;
//s[0].Visible = true;
dersVisible = fal;
//給相應(yīng)的列固定寬度
s[0].Width = 390;
s[1].Width = 390;
s[2].Width = 1100;
= 88;//設(shè)置行高
s[1].lor = k;//定義指定列的格式
s[1].ionForeColor = k;
s[0].lor = k;
s[0].ionForeColor = k;
//s[0].ent= Center;//第一列居中
s[1].ent = Center;//第二列居中
//= new ("微軟雅黑", 22F);
//();
idViewCellStyle dataGridViewCellStyle17 = new idViewCellStyle();//定義奇數(shù)行的樣式
idViewCellStyle dataGridViewCellStyle18 = new idViewCellStyle();//定義默認(rèn)行的樣式
rToAddRows = fal;
rToDeleteRows = fal;
lor = yan;
atingRowsDefaultCellStyle = dataGridViewCellStyle17;
oundColor = kyBlue;
//HeadersBorderStyle = ;
ent = Center;
//lor = gb(((int)(((byte)(211)))), ((int)(((byte)(223)))), ((int)(((byte)(240)))));
lor = ;
//lor = kyBlue;
// lor = ;
ionBackColor = ght;
ionForeColor = ghtText;
HeadersDefaultCellStyle = dataGridViewCellStyle18;
HeadersHeightSizeMode = ze;
HeadersHeightSizeMode = ze;
}
#endregion
}
= new ("微軟雅黑", 22F, r, , ((by
本文發(fā)布于:2023-12-06 16:39:38,感謝您對(duì)本站的認(rèn)可!
本文鏈接:http://www.newhan.cn/zhishi/a/1701851978237663.html
版權(quán)聲明:本站內(nèi)容均來(lái)自互聯(lián)網(wǎng),僅供演示用,請(qǐng)勿用于商業(yè)和其他非法用途。如果侵犯了您的權(quán)益請(qǐng)與我們聯(lián)系,我們將在24小時(shí)內(nèi)刪除。
本文word下載地址:C#winFrom自定義gridview樣式制作好看的大屏顯示隊(duì)列.doc
本文 PDF 下載地址:C#winFrom自定義gridview樣式制作好看的大屏顯示隊(duì)列.pdf
| 留言與評(píng)論(共有 0 條評(píng)論) |