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 に答える