0

vb.net中PartPainted(c#)的等效程序或功能或代码是什么?这是 c# 中的代码示例片段,但是当我将其转换为 vb.net 代码时,PartPainted 是未知函数。

if (PartPainted(paintParts, DataGridViewPaintParts.ContentForeground))
4

1 回答 1

3

看起来与示例中的代码非常相似,为 DataGridView 控件文章构建自定义 NumericUpDown 单元格和列:

// If the cell is in editing mode, there is nothing else to paint
if (!cellEdited)
{
    if (PartPainted(paintParts, DataGridViewPaintParts.ContentForeground))
    {
        // Paint a NumericUpDown control
        // Take the borders into account

如果是这样,它不是框架/内置函数 - 它只是同一类中的另一种方法:

/// <summary>
/// Little utility function called by the Paint function to see if a particular part needs to be painted. 
/// </summary>
private static bool PartPainted(DataGridViewPaintParts paintParts, DataGridViewPaintParts paintPart)
{
    return (paintParts & paintPart) != 0;
}

转换为 VB 应该是微不足道的。

于 2013-08-14T07:16:15.020 回答