Monday, March 31, 2014

[C++ Builder] Show a form before Mainform is shown

[Reference]
http://embarcadero.newsgroups.archived.at/public.delphi.vcl.components.using/200904/0904161856.html

Sometimes, an application requires to show a form before the Mainform. This following code shows how to create and show a form (DialogSelectLanguage) before Mainform (FornMain) is show.

Notice: DialogSelectLanguage should be moved to < Avaliable forms > ( [Project] [Options...] [Form] )



int WINAPI _tWinMain(HINSTANCE, HINSTANCE, LPTSTR, int) 

  Application->Initialize(); 
  
// Create a form before Mainform is creacted.
  DialogSelectLanguage = new TDialogSelectLanguage(Application);   // Show the form
  DialogSelectLanguage->ShowModal(); 
  ... 
  ... 
  DialogSelectLanguage->Release(); // If needed
  DialogSelectLanguage=NULL; 

  // Create Mainform  Application->CreateForm(__classid(TFormMain), &FormMain); 
  Application->Run(); 
  return 0;  
}



1 comment:

phpMyAdmin 無法存取 MariaDB 10 的解決方法

 [Reference]  https://www.qnap.com/zh-tw/how-to/faq/article/%E7%82%BA%E4%BB%80%E9%BA%BC%E7%84%A1%E6%B3%95%E5%9C%A8-phpmyadmin-%E5%AD%98%E5%8...