对于从XE7转换而来的项目,Firemonkey提示不适用于Delphi Seattle [英] Firemonkey Hints don't work in Delphi Seattle, for a project converted from XE7
问题描述
我在Delphi Seattle打开了此演示,它像应该. 当我打开程序并包含演示表单时,它不起作用.我无法向控件添加提示.
I opened this demo in Delphi Seattle and it works like it should. When I open my program, and include the demo form it doesnt work. I cannot add hints to my controls.
procedure TMainForm.FormCreate(Sender: TObject);
application.ShowHint:=true;
application.OnHint :=OnApplicationHint;
end;
procedure TMainForm.OnApplicationHint(Sender: TObject);
begin
caption := (Application.Hint);
end;
My program is converted from XE7 to Seattle. So what could be the difference?
在哪里可以找到实际显示提示的代码?
Where can i find the code that actually shows the hint??
我找到了显示提示的代码.以下内容适用于新的XE-10 Seattle程序,但不适用于从XE-7转换的程序.
EDIT : I found the code that shows a Hint. The following works in a new XE-10 Seattle program, but not in a program converted from XE-7 .
var
LToolInfo: TOOLINFO;
FNativeControlHandle,
FToolTipHandle: HWND;
begin
FNativeControlHandle := WindowHandleToPlatform(form1.Handle).Wnd;
if FNativeControlHandle <> 0 then begin
FToolTipHandle := CreateWindowEx(0, TOOLTIPS_CLASS, nil, WS_POPUP or TTS_ALWAYSTIP, 0, 0, 300, 300,FNativeControlHandle, 0, hInstance, nil);
SetWindowPos(FToolTipHandle, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE or SWP_NOSIZE or SWP_NOACTIVATE);
FillChar(LToolInfo, SizeOf(TOOLINFO), 0);
LToolInfo.cbSize := SizeOf(TOOLINFO);
LToolInfo.uFlags := TTF_SUBCLASS or TTF_IDISHWND or TTF_PARSELINKS;
LToolInfo.hinst := hInstance;
LToolInfo.hwnd := FNativeControlHandle;
LToolInfo.uId := FNativeControlHandle;
LToolInfo.lpszText := PWideChar('Hint');
SendMessage(FToolTipHandle, TTM_ADDTOOL, 0, LPARAM(@LToolInfo));
SendMessage(FToolTipHandle, TTM_ACTIVATE, NativeInt(True), LPARAM(@LToolInfo));
end;
推荐答案
在从XE7
转换的程序中,在Delphi Seattle
中不起作用时,我也遇到了类似的问题.
I had a similar problem with hints in a converted program from XE7
not working in Delphi Seattle
.
当我打开复选框"Activate runtime themes"
(德语版本中为"Laufzeit-Themes aktivieren")(Project --> Options --> Application
)时,提示出现了!
When I switched on the checkbox "Activate runtime themes"
("Laufzeit-Themes aktivieren" in my German version) (Project --> Options --> Application
) the hints appeared!
这篇关于对于从XE7转换而来的项目,Firemonkey提示不适用于Delphi Seattle的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!