tabsheet怎么双击关闭呢?没有找到双击事件
这是在delphi中的解决办法,但bcb中要出错
OnMouseDown事件
procedure TForm1.PageControl1MouseDown(Sender: TObject;
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
var
Index: Integer;
begin
if (Button = mbLeft) and (ssDouble in Shift) then
begin
Index := PageControl1.IndexOfTabAt(X, Y);
if Index >= 0 then
PageControl1.Pages[Index].Free;
end;
end;
=====================================我改成bcb的
void __fastcall TForm2::TabSheet1MouseDown(TObject *Sender,
TMouseButton Button, TShiftState Shift, int X, int Y) {
if (Button == mbLeft && ssDouble in Shift) {
PageControl1->RemoveControl(ActivePage);
PageControl1->ActivePage->Free();
}
}
错误提示:[BCC32 Error] Unit2.cpp(119): E2377 If statement missing )
Full parser context
Unit2.cpp(118): parsing: void _fastcall TForm2::TabSheet1MouseDown(TObject *,TMouseButton,TShiftState,int,int)