C++builder 怎么做ctrl+左键实现多选
如何实现这种事件,多选不用考虑,谢谢了 C++Builder
[解决办法]
我收藏的代码,自己再加工一下:
#ifndef TTS_CLOSE
#define TTS_CLOSE 0x80
#endif
void __fastcall ShowBalloonTip(TWinControl *Control, int nIcon,
LPSTR lpTitle, LPSTR lpText, TColor clBack, TColor clFore)
{
HANDLE hWnd = Control->Handle;
HANDLE hWndTip = CreateWindow(TOOLTIPS_CLASS, NULL,
WS_POPUP
[解决办法]
TTS_NOPREFIX
[解决办法]
TTS_BALLOON
[解决办法]
TTS_ALWAYSTIP
[解决办法]
TTS_CLOSE,
0, 0, 0, 0, hWnd, 0, HInstance, NULL);
TOOLINFO ti;
if(hWndTip != 0)
{
SetWindowPos(hWndTip, HWND_TOPMOST, 0, 0, 0, 0,
SWP_NOACTIVATE
[解决办法]
SWP_NOMOVE
[解决办法]
SWP_NOSIZE);
ti.cbSize = sizeof(ti);
ti.uFlags = TTF_CENTERTIP
[解决办法]
TTF_TRANSPARENT
[解决办法]
TTF_SUBCLASS;
ti.hwnd = hWnd;
ti.lpszText = lpText;
::GetClientRect(hWnd, &ti.rect);
SendMessage(hWndTip, TTM_SETTIPBKCOLOR, clBack, 0);
SendMessage(hWndTip, TTM_SETTIPTEXTCOLOR, clFore, 0);
SendMessage(hWndTip, TTM_ADDTOOL, 1, LPARAM(&ti));
SendMessage(hWndTip, TTM_SETTITLE, nIcon % 4, LPARAM(lpTitle));
}
}
void __fastcall TForm1::Button1Click(TObject *Sender)
{
ShowBalloonTip(Button2, 1, "标题", "嘿嘿,最好的Tip控件.", TColor(RGB(245,245,245)), clBlue);
}