|
#include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
int X, Y;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::SG1MouseDown(TObject *Sender, TMouseButton Button,
TShiftState Shift, int X, int Y)
{
X, Y;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::SG1SelectCell(TObject *Sender, int ACol, int ARow,
bool &CanSelect)
{
int c, r;
TRect t;
SG1->MouseToCell( X, Y, c, r);
if (r<1) return;
c=4;
ARow = r;
t = SG1->CellRect(c, r);
ComboBox1->Left = SG1->Left + t.Left+1;
ComboBox1->Top = SG1->Top + t.Top+1;
ComboBox1->Width = (t.Right - t.Left)+3;
ComboBox1->Visible = true;
}
//---------------------------------------------------------------------------
Q&A 에서 찾은걸 응용해봤거든요..그냥 갔다가 붙여봤어요..사실 개념은 잘 몰겠구요.
자세한 설명좀 부탁드립니다..책을 뒤저 봤는데..이런 이벤트 처리에 대해서는 잘 안나오더라구요..
고수님들 오늘도 부탁드립니다..꾸벅
|