File tree Expand file tree Collapse file tree 2 files changed +37
-0
lines changed
CefSharp.WinForms.Example Expand file tree Collapse file tree 2 files changed +37
-0
lines changed Original file line number Diff line number Diff line change 9999 <Compile Include =" InputBox.Designer.cs" >
100100 <DependentUpon >InputBox.cs</DependentUpon >
101101 </Compile >
102+ <Compile Include =" Minimal\MultiFormAppContext.cs" />
102103 <Compile Include =" Minimal\SimpleBrowserForm.cs" >
103104 <SubType >Form</SubType >
104105 </Compile >
Original file line number Diff line number Diff line change 1+ // Copyright © 2019 The CefSharp Authors. All rights reserved.
2+ //
3+ // Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
4+
5+ using System . Windows . Forms ;
6+
7+ namespace CefSharp . WinForms . Example . Minimal
8+ {
9+ public class MultiFormAppContext : ApplicationContext
10+ {
11+ private SimpleBrowserForm form1 ;
12+ private SimpleBrowserForm form2 ;
13+
14+ public MultiFormAppContext ( bool multiThreadedMessageLoop )
15+ {
16+ form1 = new SimpleBrowserForm ( multiThreadedMessageLoop ) ;
17+ form1 . WindowState = FormWindowState . Normal ;
18+ form2 = new SimpleBrowserForm ( multiThreadedMessageLoop ) ;
19+ form2 . WindowState = FormWindowState . Normal ;
20+
21+ form1 . FormClosed += OnFormClosed ;
22+ form2 . FormClosed += OnFormClosed ;
23+
24+ form1 . Show ( ) ;
25+ form2 . Show ( ) ;
26+ }
27+
28+ private void OnFormClosed ( object sender , FormClosedEventArgs e )
29+ {
30+ if ( Application . OpenForms . Count == 0 )
31+ {
32+ ExitThread ( ) ;
33+ }
34+ }
35+ }
36+ }
You can’t perform that action at this time.
0 commit comments