1
新功能介绍
Introduction to new functions
图1:PN码Library界面增加了复选框
图2:多选删除的效果演示
2
有关问题
Answer
Q1
关于DataGridViewDisableCheckBoxCell
自己魔改的一个开源checkbox控件,专门放在datagridview的行里作为行控件使用,包括head行用的也是这个,利用.net开发的优势,可以做各种复杂的控件效果。DataGridViewDisableCheckBoxCell控件的代码直接分享:
public class DataGridViewDisableCheckBoxCell : DataGridViewCheckBoxCell
{
private bool enabledValue;
/// <summary>
/// This property decides whether the checkbox should be shown checked or unchecked.
/// </summary>
public bool Enabled
{
get
{
return enabledValue;
}
set
{
enabledValue = value;
}
}
/// Override the Clone method so that the Enabled property is copied.
public override object Clone()
{
DataGridViewDisableCheckBoxCell cell =
(DataGridViewDisableCheckBoxCell)base.Clone();
cell.Enabled = this.Enabled;
return cell;
}
public DataGridViewDisableCheckBoxCell()
{
this.enabledValue = true;
}
protected override void Paint(Graphics graphics,
Rectangle clipBounds, Rectangle cellBounds, int rowIndex,
DataGridViewElementStates elementState, object value,
object formattedValue, string errorText,
DataGridViewCellStyle cellStyle,
DataGridViewAdvancedBorderStyle advancedBorderStyle,
DataGridViewPaintParts paintParts)
{
// The checkBox cell is disabled, so paint the border,
// background, and disabled checkBox for the cell.
if (!this.enabledValue)
{
// Draw the cell background, if specified.
if ((paintParts & DataGridViewPaintParts.Background) ==
DataGridViewPaintParts.Background)
{
SolidBrush cellBackground =
new SolidBrush(cellStyle.BackColor);
graphics.FillRectangle(cellBackground, cellBounds);
cellBackground.Dispose();
}
// Draw the cell borders, if specified.
if ((paintParts & DataGridViewPaintParts.Border) ==
DataGridViewPaintParts.Border)
{
PaintBorder(graphics, clipBounds, cellBounds, cellStyle,
advancedBorderStyle);
}
// Calculate the area in which to draw the checkBox.
CheckBoxState state = value.ToString() != "0" && (bool)value ?
CheckBoxState.CheckedDisabled : CheckBoxState.UncheckedDisabled;
Size size = CheckBoxRenderer.GetGlyphSize(graphics, state);
Point center = new Point(cellBounds.X, cellBounds.Y);
center.X += (cellBounds.Width - size.Width) / 2;
center.Y += (cellBounds.Height - size.Height) / 2;
// Draw the disabled checkBox.
CheckBoxRenderer.DrawCheckBox(graphics, center, state);
}
else
{
// The checkBox cell is enabled, so let the base class
// handle the painting.
base.Paint(graphics, clipBounds, cellBounds, rowIndex,
elementState, value, formattedValue, errorText,
cellStyle, advancedBorderStyle, paintParts);
}
}
}
3
什么是Naki.CI
What is Naki.CI
Naki.CI 是一个PDMS二次开发插件,执行一套简易的、可维护的编码规则,根据编码规则正向生成物资编码(CC码)和采购编码(PN码),编码信息写入到PDMS,出图和出材料表直接带编码和材料描述,打通设计建模和材料管理,一次性解决材料赋码问题。
4
Naki.CI介绍PPT
https://pan.baidu.com/s/1Ql_Qf9QWsYpU9J1KNtmwkg?pwd=ene9
Naki.CI视频《先睹为快》
https://www.bilibili.com/video/BV1m34y187es?share_source=copy_web