0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

c++ builder XE4, 10.2 Tokyo > TForm > FormがShowModal()で開かれたか、Show()で開かれたかの確認 > if (FormState.Contains(fsModal)) {

Last updated at Posted at 2015-10-04
動作確認
C++ Builder XE4
Rad Studio 10.2 Tokyo Update 2 (追記: 2017/12/26)

FormAからFormBを開いた時、FormB側のOnShow()でShow()とShowModal()のどちらで開いたか確認したかった。

StackOverflowで聞いたところ、delphiコードを教えていただいた。
SO

delphiのif fsModal in FormState thenをC++ Builderのコードにすると以下となることがわかった。
参考: http://www.borlandtalk.com/tform-question-vt17251.html

void __fastcall TForm1::FormShow(TObject *Sender)
{
    if (FormState.Contains(fsModal)) {
        ShowMessage(L"ShowModal");
    } else {
        ShowMessage(L"Show");
    }
}
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?