procedure TFrmOperate.CbOnTopClick(Sender: TObject);
begin
if CbOnTop.Checked then
begin
Self.FormStyle := fsStayOnTop;
end else
begin
Self.FormStyle := fsNormal;
end;
end;我想让用户能通过一个 CheckBox来选择是否让窗体一直在最上方,但我如上的代码不能实现,当选择一直在上时,还是能被其他的窗体挡住。不知道为什么?
begin
if CbOnTop.Checked then
begin
Self.FormStyle := fsStayOnTop;
end else
begin
Self.FormStyle := fsNormal;
end;
end;我想让用户能通过一个 CheckBox来选择是否让窗体一直在最上方,但我如上的代码不能实现,当选择一直在上时,还是能被其他的窗体挡住。不知道为什么?
还有,好像如果在你的窗口建立(显示)以后,再改变这个fsStayOnTop就没有意义了,不知道对不对,你可以试试其它方法阿。