RT

解决方案 »

  1.   

    用API 函数,可以定义窗体始终在前面.
      

  2.   

    楼上的对,我那个方法窗体有闪烁的,用api吧,SetWindowsPos(...);
      

  3.   

    从助手中出过来的代码:)你看看        ShowWindow(PrevInstHandle, SW_RESTORE)
          else
            BringWindowToTop(PrevInstHandle);
          SetForegroundWindow(PrevInstHandle);
    ------------------------------------  《CSDN论坛新助手 CSDN's forum Explorer》
      1、更快速的浏览
      2、更方便地保存
      3、更快捷的收/发短信
      下载地址:http://www.seeyou.com.cn/CoolSlob/CSDNExplorer.exe
      

  4.   

    BOOL BringWindowToTop(
      HWND hWnd   // handle to window
    );
      

  5.   

    我随便写了个函数,你看看吧.
    //delphi 7procedure TForm1.SetFormOnTop(Form:TForm;F:Boolean);
    begin
      if F then
        SetWindowPos(Form.Handle, HWND_TOPMOST, 0, 0, 0, 0,
               SWP_NOMOVE or SWP_NOSIZE)
      else
        SetWindowPos(Form.Handle, HWND_NOTOPMOST, 0, 0, 0, 0,
               SWP_NOMOVE or SWP_NOSIZE);
    end;//C++ Builder6void __fastcall TMainForm::SetFormOnTop(TForm *Form,bool isTop)
    {
      if(isTop)
        SetWindowPos(Form->Handle,HWND_TOPMOST,0,0,0,0,SWP_NOMOVE|SWP_NOSIZE);
      else
        SetWindowPos(Form->Handle,HWND_NOTOPMOST,0,0,0,0,SWP_NOMOVE|SWP_NOSIZE);
    }