0

私はデータグリッドビューを持っていて、次のように入力します:

DataGridViewRow^ row = gcnew DataGridViewRow;

        DataGridViewCheckBoxCell^ CBox = gcnew DataGridViewCheckBox;//DataGridViewCheckBoxCell();
        row->Cells->Add( CBox );
        CBox->Value = false;
        CBox->ReadOnly = false;

        DataGridViewTextBoxCell^ PName = gcnew DataGridViewTextBoxCell();
        row->Cells->Add( PName );
        PName->Value = strPackageName;
        PName->ReadOnly = true;

        DataGridViewTextBoxCell^ AppV = gcnew DataGridViewTextBoxCell();
        row->Cells->Add( AppV );
        AppV->Value = strAppVendor;
        AppV->ReadOnly = true;

        DataGridViewTextBoxCell^ AppN = gcnew DataGridViewTextBoxCell();
        row->Cells->Add( AppN );
        AppN->Value = strAppName;
        AppN->ReadOnly = true;

dataGridView1->Rows->Add( row );

私は次のことをしたいです。チェックボックスをクリックすると、行の色を変更したい。残念ながら、すべてのイベントに問題があるため、データグリッドの対応するイベントが見つかりませんでした。どのイベントを使用すればよいか、またはこれをどのように行うべきか教えてもらえますか?

ありがとう!

4

1 に答える 1

0

うまくいくことを願っています。

  if (CBox->Checked)
  {
      PName->BackColor = Color::Red;
      AppV->BackColor = Color::Red;
      AppN->BackColor = Color::Red;

  }
于 2012-06-05T09:41:51.603 に答える