LoginSignup
0
1

More than 5 years have passed since last update.

C++ Builder / TStringGrid > 固定列上でマウスクリックした場合に{Row, Col}を取得する

Last updated at Posted at 2017-04-13
動作環境
C++ Builder XE4

参考 http://www.delphigroups.info/2/18/296188.html

MouseToCell()を使うようだ。

ためしに、クリックしたところが固定列かどうかチェックする関数を実装してみた。

bool __fastcall TFormUserList::isFixedColMouseUp(int X, int Y, TStringGrid *srcPtr)
{
    if (srcPtr == NULL) {
        return false;
    }
    int Row, Col;
    srcPtr->MouseToCell(X, Y, Col, Row);

    if (Col < 0 || Row < 0) {
        return false;
    }

    if (Col < srcPtr->FixedCols) {
        return true;
    }
    return false;
}

TStringGridのOptionsプロパティに「goFixedColClick」という項目があり、Falseとしていた。ここをTrueにすれば、通常のクリックイベントでも処理できるかもしれない。

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1