TForm.TipMode属性用于什么?
它是在Delphi XE3中添加的,但是文档中没有提到这个属性。
发布于 2014-07-21 22:13:27
TTipMode是在Controls.pas中定义的,用于跟踪ITextInputPanel接口中TabTip.exe中可用的文本输入面板的状态(打开或关闭)。
procedure TWinControl.UpdateTIPStatus;
begin
if Assigned(FTIPIntf) then
begin
if TipMode = tipOpen then SetTextInputPanelStatus(Self, True)
else if TipMode = tipClose then SetTextInputPanelStatus(Self, False);
end;
end;下面是从这个方法调用的SetTextInputPanelStatus过程:
procedure SetTextInputPanelStatus(Control: TWinControl; OpenTIP: Boolean);
procedure InvokeTabTip;
const
DefaultTabTipPath = 'C:\Program Files\Common Files\microsoft shared\ink\TabTip.exe';
DefaultOnScreenKeyboardPath = 'C:\Windows\System32\OSK.exe';
var
TabTipPath: string;
begin
TabTipPath := DefaultTabTipPath;
ShellExecute(0, 'open', PChar(TabTipPath), nil, nil, SW_SHOWNOACTIVATE);
end;
procedure OPenTip2;
begin
(Control.FTIPIntf as ITextInputPanel).SetInPlaceVisibility(1); // True
end;
procedure CloseTip;
begin
(Control.FTIPIntf as ITextInputPanel).SetInPlaceVisibility(0); // False
end;
begin
if Assigned(Control.FTIPIntf) then
begin
if OpenTIP then OpenTip2 // InvokeTabTip
else CloseTip;
end;
end;这表明,如果最后一个参数(OpenTip)是True,它将打开带有命令行的文本输入面板到程序(在OpenTip中完成)。如果参数为False,则关闭该窗口。通过在DefaultTabTipPath指定的位置执行应用程序,可以看到文本输入窗口。
(请注意,包含上述常量的InvokeTabTip代码从未执行;对它的调用将被注释掉。感谢@SertacAkyuz指出这一点。我已经编辑了这些信息。)
https://stackoverflow.com/questions/24875468
复制相似问题