デュアルディスプレイのセカンドモニターにPDF、動画、画像を表示。
@@ -92,15 +92,27 @@ | ||
92 | 92 | |
93 | 93 | <Global.System.Configuration.UserScopedSettingAttribute(), _ |
94 | 94 | Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ |
95 | - Global.System.Configuration.DefaultSettingValueAttribute("")> _ | |
96 | - Public Property 設定() As String | |
95 | + Global.System.Configuration.DefaultSettingValueAttribute("0")> _ | |
96 | + Public Property nudHeight() As Integer | |
97 | 97 | Get |
98 | - Return CType(Me("設定"),String) | |
98 | + Return CType(Me("nudHeight"),Integer) | |
99 | 99 | End Get |
100 | 100 | Set |
101 | - Me("設定") = value | |
101 | + Me("nudHeight") = value | |
102 | 102 | End Set |
103 | 103 | End Property |
104 | + | |
105 | + <Global.System.Configuration.UserScopedSettingAttribute(), _ | |
106 | + Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ | |
107 | + Global.System.Configuration.DefaultSettingValueAttribute("0")> _ | |
108 | + Public Property nudWidth() As Integer | |
109 | + Get | |
110 | + Return CType(Me("nudWidth"),Integer) | |
111 | + End Get | |
112 | + Set | |
113 | + Me("nudWidth") = value | |
114 | + End Set | |
115 | + End Property | |
104 | 116 | End Class |
105 | 117 | End Namespace |
106 | 118 |
@@ -27,8 +27,11 @@ | ||
27 | 27 | End Sub |
28 | 28 | |
29 | 29 | #Region "設定値" |
30 | + Private loading As Boolean | |
30 | 31 | Private Sub AppSettingLoad() |
31 | - | |
32 | + loading = True | |
33 | + nudHeight.Value = My.Settings.nudHeight | |
34 | + nudWidth.Value = My.Settings.nudWidth | |
32 | 35 | cmbDisplay.SelectedIndex = My.Settings.cmbDisplaySelectedIndex |
33 | 36 | cmbPDFView.SelectedIndex = My.Settings.cmbView |
34 | 37 | nudPdfZoom.Value = My.Settings.nupPDFZoom |
@@ -52,7 +55,7 @@ | ||
52 | 55 | Catch ex As Exception |
53 | 56 | MessageBox.Show(ex.Message) |
54 | 57 | End Try |
55 | - | |
58 | + loading = False | |
56 | 59 | End Sub |
57 | 60 | |
58 | 61 | Private Sub AppSettingSave() |
@@ -60,6 +63,8 @@ | ||
60 | 63 | My.Settings.cmbDisplaySelectedIndex = cmbDisplay.SelectedIndex |
61 | 64 | My.Settings.cmbView = cmbPDFView.SelectedIndex |
62 | 65 | My.Settings.nupPDFZoom = nudPdfZoom.Value |
66 | + My.Settings.nudHeight = nudHeight.Value | |
67 | + My.Settings.nudWidth = nudWidth.Value | |
63 | 68 | My.Settings.Save() |
64 | 69 | |
65 | 70 | Dim fvinfos As New List(Of fileviewInfo) |
@@ -97,6 +102,7 @@ | ||
97 | 102 | |
98 | 103 | #Region "フォームをセカンドディスプレイに表示" |
99 | 104 | Private Sub cmbDisplay_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cmbDisplay.SelectedIndexChanged |
105 | + | |
100 | 106 | If cmbDisplay.SelectedIndex < 0 Then |
101 | 107 | Exit Sub |
102 | 108 | End If |
@@ -108,9 +114,11 @@ | ||
108 | 114 | ' 'フォームの開始位置をディスプレイの左上座標に設定する |
109 | 115 | frmView.StartPosition = FormStartPosition.Manual |
110 | 116 | frmView.Location = s.Bounds.Location |
111 | - frmView.Size = s.Bounds.Size | |
112 | - nudHeight.Value = frmView.Size.Height | |
113 | - nudWidth.Value = frmView.Size.Width | |
117 | + If Not loading OrElse nudHeight.Value = 0 Then | |
118 | + nudHeight.Value = s.Bounds.Size.Height | |
119 | + nudWidth.Value = s.Bounds.Size.Width | |
120 | + End If | |
121 | + | |
114 | 122 | End Sub |
115 | 123 | |
116 | 124 |