設置InputQuery的字体

調用前賦一個事件:
      AnsiString NewString = cfid;
      TNotifyEvent ActiveFun;
      ActiveFun = Screen->OnActiveFormChange;
      Screen->OnActiveFormChange = InputActive;
      if (InputQuery("提示", "輸入值", NewString))
      {
          ...
      }
//-----------------
事件如下:
void __fastcall TfrmRcyw::InputActive(TObject *Sender)
{
    if(Screen->ActiveForm->ClassNameIs("TForm"))
    {
          Screen->ActiveForm->ScaleBy(10, Screen->ActiveForm->Font->Size);
          Screen->ActiveForm->Font->Name="宋体";
          HWND mainh=(HWND)Screen->ActiveForm->Handle,h;
          char str[255];
          while(h)
          {
  
          GetWindowText(h,str,255);
             if(strcmp(str,"OK")==0)
                SetWindowText(h,"确定");
             if(strcmp(str,"Cancel")==0)
                SetWindowText(h,"取消");
             h=GetWindow(h,GW_HWNDNEXT);
          }         
    }
}

//------------------------------

調用結束后再恢复原型
Screen->OnActiveFormChange = ActiveFun;

阅读更多
版权声明:原创文章转载时请附上原文链接 https://blog.csdn.net/aniven/article/details/556259
个人分类: C++/BCB开发
上一篇Delphi BCB 開發出xp風格的程式(转载)
下一篇用代碼控制程式最小化和恢復
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

关闭
关闭
关闭