デュアルディスプレイのセカンドモニターにPDF、動画、画像を表示。
@@ -22,79 +22,87 @@ | ||
22 | 22 | 'コード エディターを使って変更しないでください。 |
23 | 23 | <System.Diagnostics.DebuggerStepThrough()> _ |
24 | 24 | Private Sub InitializeComponent() |
25 | - Me.btnNext = New System.Windows.Forms.Button() | |
26 | - Me.btnBack = New System.Windows.Forms.Button() | |
27 | - Me.btnFileOpen = New System.Windows.Forms.Button() | |
28 | - Me.txtFileName = New System.Windows.Forms.TextBox() | |
25 | + Me.btnPDFNext = New System.Windows.Forms.Button() | |
26 | + Me.btnPDFBack = New System.Windows.Forms.Button() | |
27 | + Me.btnOpenPDFFile = New System.Windows.Forms.Button() | |
28 | + Me.txtPDFFileName = New System.Windows.Forms.TextBox() | |
29 | 29 | Me.OpenFileDialog1 = New System.Windows.Forms.OpenFileDialog() |
30 | - Me.btnLast = New System.Windows.Forms.Button() | |
31 | - Me.btnFirst = New System.Windows.Forms.Button() | |
30 | + Me.btnPDFLast = New System.Windows.Forms.Button() | |
31 | + Me.btnPDFFirst = New System.Windows.Forms.Button() | |
32 | 32 | Me.cmbDisplay = New System.Windows.Forms.ComboBox() |
33 | 33 | Me.Label1 = New System.Windows.Forms.Label() |
34 | - Me.cmbView = New System.Windows.Forms.ComboBox() | |
34 | + Me.cmbPDFView = New System.Windows.Forms.ComboBox() | |
35 | 35 | Me.Label2 = New System.Windows.Forms.Label() |
36 | - Me.btnFileClose = New System.Windows.Forms.Button() | |
36 | + Me.btnPDFFileClose = New System.Windows.Forms.Button() | |
37 | 37 | Me.GroupBox1 = New System.Windows.Forms.GroupBox() |
38 | + Me.tbcFileOpes = New System.Windows.Forms.TabControl() | |
39 | + Me.tpAdobePDF = New System.Windows.Forms.TabPage() | |
40 | + Me.tpMediaPlayer = New System.Windows.Forms.TabPage() | |
41 | + Me.btnOpenMediaFile = New System.Windows.Forms.Button() | |
42 | + Me.btnStartStop = New System.Windows.Forms.Button() | |
43 | + Me.txtMediaFileName = New System.Windows.Forms.TextBox() | |
38 | 44 | Me.GroupBox1.SuspendLayout() |
45 | + Me.tbcFileOpes.SuspendLayout() | |
46 | + Me.tpAdobePDF.SuspendLayout() | |
47 | + Me.tpMediaPlayer.SuspendLayout() | |
39 | 48 | Me.SuspendLayout() |
40 | 49 | ' |
41 | - 'btnNext | |
50 | + 'btnPDFNext | |
42 | 51 | ' |
43 | - Me.btnNext.Location = New System.Drawing.Point(129, 173) | |
44 | - Me.btnNext.Name = "btnNext" | |
45 | - Me.btnNext.Size = New System.Drawing.Size(50, 23) | |
46 | - Me.btnNext.TabIndex = 2 | |
47 | - Me.btnNext.Text = "次へ" | |
48 | - Me.btnNext.UseVisualStyleBackColor = True | |
52 | + Me.btnPDFNext.Location = New System.Drawing.Point(143, 94) | |
53 | + Me.btnPDFNext.Name = "btnPDFNext" | |
54 | + Me.btnPDFNext.Size = New System.Drawing.Size(50, 23) | |
55 | + Me.btnPDFNext.TabIndex = 2 | |
56 | + Me.btnPDFNext.Text = "次へ" | |
57 | + Me.btnPDFNext.UseVisualStyleBackColor = True | |
49 | 58 | ' |
50 | - 'btnBack | |
59 | + 'btnPDFBack | |
51 | 60 | ' |
52 | - Me.btnBack.Location = New System.Drawing.Point(73, 173) | |
53 | - Me.btnBack.Name = "btnBack" | |
54 | - Me.btnBack.Size = New System.Drawing.Size(50, 23) | |
55 | - Me.btnBack.TabIndex = 2 | |
56 | - Me.btnBack.Text = "前へ" | |
57 | - Me.btnBack.UseVisualStyleBackColor = True | |
61 | + Me.btnPDFBack.Location = New System.Drawing.Point(87, 94) | |
62 | + Me.btnPDFBack.Name = "btnPDFBack" | |
63 | + Me.btnPDFBack.Size = New System.Drawing.Size(50, 23) | |
64 | + Me.btnPDFBack.TabIndex = 2 | |
65 | + Me.btnPDFBack.Text = "前へ" | |
66 | + Me.btnPDFBack.UseVisualStyleBackColor = True | |
58 | 67 | ' |
59 | - 'btnFileOpen | |
68 | + 'btnOpenPDFFile | |
60 | 69 | ' |
61 | - Me.btnFileOpen.Location = New System.Drawing.Point(12, 95) | |
62 | - Me.btnFileOpen.Name = "btnFileOpen" | |
63 | - Me.btnFileOpen.Size = New System.Drawing.Size(101, 23) | |
64 | - Me.btnFileOpen.TabIndex = 3 | |
65 | - Me.btnFileOpen.Text = "ファイルを開く" | |
66 | - Me.btnFileOpen.UseVisualStyleBackColor = True | |
70 | + Me.btnOpenPDFFile.Location = New System.Drawing.Point(26, 16) | |
71 | + Me.btnOpenPDFFile.Name = "btnOpenPDFFile" | |
72 | + Me.btnOpenPDFFile.Size = New System.Drawing.Size(101, 23) | |
73 | + Me.btnOpenPDFFile.TabIndex = 3 | |
74 | + Me.btnOpenPDFFile.Text = "ファイルを開く" | |
75 | + Me.btnOpenPDFFile.UseVisualStyleBackColor = True | |
67 | 76 | ' |
68 | - 'txtFileName | |
77 | + 'txtPDFFileName | |
69 | 78 | ' |
70 | - Me.txtFileName.Location = New System.Drawing.Point(12, 124) | |
71 | - Me.txtFileName.Name = "txtFileName" | |
72 | - Me.txtFileName.ReadOnly = True | |
73 | - Me.txtFileName.Size = New System.Drawing.Size(766, 22) | |
74 | - Me.txtFileName.TabIndex = 4 | |
79 | + Me.txtPDFFileName.Location = New System.Drawing.Point(26, 45) | |
80 | + Me.txtPDFFileName.Name = "txtPDFFileName" | |
81 | + Me.txtPDFFileName.ReadOnly = True | |
82 | + Me.txtPDFFileName.Size = New System.Drawing.Size(655, 22) | |
83 | + Me.txtPDFFileName.TabIndex = 4 | |
75 | 84 | ' |
76 | 85 | 'OpenFileDialog1 |
77 | 86 | ' |
78 | 87 | Me.OpenFileDialog1.FileName = "OpenFileDialog1" |
79 | - Me.OpenFileDialog1.Filter = "PDFファイル (*.pdf) |*.pdf" | |
80 | 88 | ' |
81 | - 'btnLast | |
89 | + 'btnPDFLast | |
82 | 90 | ' |
83 | - Me.btnLast.Location = New System.Drawing.Point(185, 173) | |
84 | - Me.btnLast.Name = "btnLast" | |
85 | - Me.btnLast.Size = New System.Drawing.Size(49, 23) | |
86 | - Me.btnLast.TabIndex = 5 | |
87 | - Me.btnLast.Text = "最後へ" | |
88 | - Me.btnLast.UseVisualStyleBackColor = True | |
91 | + Me.btnPDFLast.Location = New System.Drawing.Point(199, 94) | |
92 | + Me.btnPDFLast.Name = "btnPDFLast" | |
93 | + Me.btnPDFLast.Size = New System.Drawing.Size(49, 23) | |
94 | + Me.btnPDFLast.TabIndex = 5 | |
95 | + Me.btnPDFLast.Text = "最後へ" | |
96 | + Me.btnPDFLast.UseVisualStyleBackColor = True | |
89 | 97 | ' |
90 | - 'btnFirst | |
98 | + 'btnPDFFirst | |
91 | 99 | ' |
92 | - Me.btnFirst.Location = New System.Drawing.Point(17, 173) | |
93 | - Me.btnFirst.Name = "btnFirst" | |
94 | - Me.btnFirst.Size = New System.Drawing.Size(50, 23) | |
95 | - Me.btnFirst.TabIndex = 5 | |
96 | - Me.btnFirst.Text = "最初へ" | |
97 | - Me.btnFirst.UseVisualStyleBackColor = True | |
100 | + Me.btnPDFFirst.Location = New System.Drawing.Point(31, 94) | |
101 | + Me.btnPDFFirst.Name = "btnPDFFirst" | |
102 | + Me.btnPDFFirst.Size = New System.Drawing.Size(50, 23) | |
103 | + Me.btnPDFFirst.TabIndex = 5 | |
104 | + Me.btnPDFFirst.Text = "最初へ" | |
105 | + Me.btnPDFFirst.UseVisualStyleBackColor = True | |
98 | 106 | ' |
99 | 107 | 'cmbDisplay |
100 | 108 | ' |
@@ -114,33 +122,33 @@ | ||
114 | 122 | Me.Label1.TabIndex = 7 |
115 | 123 | Me.Label1.Text = "表示するディスプレイ" |
116 | 124 | ' |
117 | - 'cmbView | |
125 | + 'cmbPDFView | |
118 | 126 | ' |
119 | - Me.cmbView.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList | |
120 | - Me.cmbView.FormattingEnabled = True | |
121 | - Me.cmbView.Items.AddRange(New Object() {"Fit", "FitH", "FitV", "FitB", "FitBH", "FitB"}) | |
122 | - Me.cmbView.Location = New System.Drawing.Point(83, 220) | |
123 | - Me.cmbView.Name = "cmbView" | |
124 | - Me.cmbView.Size = New System.Drawing.Size(121, 23) | |
125 | - Me.cmbView.TabIndex = 8 | |
127 | + Me.cmbPDFView.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList | |
128 | + Me.cmbPDFView.FormattingEnabled = True | |
129 | + Me.cmbPDFView.Items.AddRange(New Object() {"Fit", "FitH", "FitV", "FitB", "FitBH", "FitB"}) | |
130 | + Me.cmbPDFView.Location = New System.Drawing.Point(97, 141) | |
131 | + Me.cmbPDFView.Name = "cmbPDFView" | |
132 | + Me.cmbPDFView.Size = New System.Drawing.Size(121, 23) | |
133 | + Me.cmbPDFView.TabIndex = 8 | |
126 | 134 | ' |
127 | 135 | 'Label2 |
128 | 136 | ' |
129 | 137 | Me.Label2.AutoSize = True |
130 | - Me.Label2.Location = New System.Drawing.Point(19, 223) | |
138 | + Me.Label2.Location = New System.Drawing.Point(33, 144) | |
131 | 139 | Me.Label2.Name = "Label2" |
132 | 140 | Me.Label2.Size = New System.Drawing.Size(59, 15) |
133 | 141 | Me.Label2.TabIndex = 9 |
134 | 142 | Me.Label2.Text = "SetView" |
135 | 143 | ' |
136 | - 'btnFileClose | |
144 | + 'btnPDFFileClose | |
137 | 145 | ' |
138 | - Me.btnFileClose.Location = New System.Drawing.Point(124, 95) | |
139 | - Me.btnFileClose.Name = "btnFileClose" | |
140 | - Me.btnFileClose.Size = New System.Drawing.Size(105, 23) | |
141 | - Me.btnFileClose.TabIndex = 10 | |
142 | - Me.btnFileClose.Text = "ファイルを閉じる" | |
143 | - Me.btnFileClose.UseVisualStyleBackColor = True | |
146 | + Me.btnPDFFileClose.Location = New System.Drawing.Point(138, 16) | |
147 | + Me.btnPDFFileClose.Name = "btnPDFFileClose" | |
148 | + Me.btnPDFFileClose.Size = New System.Drawing.Size(105, 23) | |
149 | + Me.btnPDFFileClose.TabIndex = 10 | |
150 | + Me.btnPDFFileClose.Text = "ファイルを閉じる" | |
151 | + Me.btnPDFFileClose.UseVisualStyleBackColor = True | |
144 | 152 | ' |
145 | 153 | 'GroupBox1 |
146 | 154 | ' |
@@ -153,41 +161,111 @@ | ||
153 | 161 | Me.GroupBox1.TabStop = False |
154 | 162 | Me.GroupBox1.Text = "設定" |
155 | 163 | ' |
164 | + 'tbcFileOpes | |
165 | + ' | |
166 | + Me.tbcFileOpes.Controls.Add(Me.tpAdobePDF) | |
167 | + Me.tbcFileOpes.Controls.Add(Me.tpMediaPlayer) | |
168 | + Me.tbcFileOpes.Location = New System.Drawing.Point(17, 89) | |
169 | + Me.tbcFileOpes.Name = "tbcFileOpes" | |
170 | + Me.tbcFileOpes.SelectedIndex = 0 | |
171 | + Me.tbcFileOpes.Size = New System.Drawing.Size(768, 303) | |
172 | + Me.tbcFileOpes.TabIndex = 12 | |
173 | + ' | |
174 | + 'tpAdobePDF | |
175 | + ' | |
176 | + Me.tpAdobePDF.Controls.Add(Me.btnOpenPDFFile) | |
177 | + Me.tpAdobePDF.Controls.Add(Me.btnPDFNext) | |
178 | + Me.tpAdobePDF.Controls.Add(Me.btnPDFFileClose) | |
179 | + Me.tpAdobePDF.Controls.Add(Me.btnPDFBack) | |
180 | + Me.tpAdobePDF.Controls.Add(Me.Label2) | |
181 | + Me.tpAdobePDF.Controls.Add(Me.txtPDFFileName) | |
182 | + Me.tpAdobePDF.Controls.Add(Me.cmbPDFView) | |
183 | + Me.tpAdobePDF.Controls.Add(Me.btnPDFLast) | |
184 | + Me.tpAdobePDF.Controls.Add(Me.btnPDFFirst) | |
185 | + Me.tpAdobePDF.Location = New System.Drawing.Point(4, 25) | |
186 | + Me.tpAdobePDF.Name = "tpAdobePDF" | |
187 | + Me.tpAdobePDF.Padding = New System.Windows.Forms.Padding(3) | |
188 | + Me.tpAdobePDF.Size = New System.Drawing.Size(760, 274) | |
189 | + Me.tpAdobePDF.TabIndex = 0 | |
190 | + Me.tpAdobePDF.Text = "PDFの表示" | |
191 | + Me.tpAdobePDF.UseVisualStyleBackColor = True | |
192 | + ' | |
193 | + 'tpMediaPlayer | |
194 | + ' | |
195 | + Me.tpMediaPlayer.Controls.Add(Me.btnOpenMediaFile) | |
196 | + Me.tpMediaPlayer.Controls.Add(Me.btnStartStop) | |
197 | + Me.tpMediaPlayer.Controls.Add(Me.txtMediaFileName) | |
198 | + Me.tpMediaPlayer.Location = New System.Drawing.Point(4, 25) | |
199 | + Me.tpMediaPlayer.Name = "tpMediaPlayer" | |
200 | + Me.tpMediaPlayer.Padding = New System.Windows.Forms.Padding(3) | |
201 | + Me.tpMediaPlayer.Size = New System.Drawing.Size(760, 274) | |
202 | + Me.tpMediaPlayer.TabIndex = 1 | |
203 | + Me.tpMediaPlayer.Text = "wmvの再生" | |
204 | + Me.tpMediaPlayer.UseVisualStyleBackColor = True | |
205 | + ' | |
206 | + 'btnOpenMediaFile | |
207 | + ' | |
208 | + Me.btnOpenMediaFile.Location = New System.Drawing.Point(15, 19) | |
209 | + Me.btnOpenMediaFile.Name = "btnOpenMediaFile" | |
210 | + Me.btnOpenMediaFile.Size = New System.Drawing.Size(101, 23) | |
211 | + Me.btnOpenMediaFile.TabIndex = 13 | |
212 | + Me.btnOpenMediaFile.Text = "ファイルを開く" | |
213 | + Me.btnOpenMediaFile.UseVisualStyleBackColor = True | |
214 | + ' | |
215 | + 'btnStartStop | |
216 | + ' | |
217 | + Me.btnStartStop.Location = New System.Drawing.Point(59, 86) | |
218 | + Me.btnStartStop.Name = "btnStartStop" | |
219 | + Me.btnStartStop.Size = New System.Drawing.Size(82, 23) | |
220 | + Me.btnStartStop.TabIndex = 11 | |
221 | + Me.btnStartStop.Text = "再生する" | |
222 | + Me.btnStartStop.UseVisualStyleBackColor = True | |
223 | + ' | |
224 | + 'txtMediaFileName | |
225 | + ' | |
226 | + Me.txtMediaFileName.Location = New System.Drawing.Point(15, 48) | |
227 | + Me.txtMediaFileName.Name = "txtMediaFileName" | |
228 | + Me.txtMediaFileName.ReadOnly = True | |
229 | + Me.txtMediaFileName.Size = New System.Drawing.Size(655, 22) | |
230 | + Me.txtMediaFileName.TabIndex = 14 | |
231 | + ' | |
156 | 232 | 'frmOperation |
157 | 233 | ' |
158 | 234 | Me.AutoScaleDimensions = New System.Drawing.SizeF(8.0!, 15.0!) |
159 | 235 | Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font |
160 | - Me.ClientSize = New System.Drawing.Size(782, 282) | |
236 | + Me.ClientSize = New System.Drawing.Size(782, 465) | |
237 | + Me.Controls.Add(Me.tbcFileOpes) | |
161 | 238 | Me.Controls.Add(Me.GroupBox1) |
162 | - Me.Controls.Add(Me.btnFileClose) | |
163 | - Me.Controls.Add(Me.Label2) | |
164 | - Me.Controls.Add(Me.cmbView) | |
165 | - Me.Controls.Add(Me.btnFirst) | |
166 | - Me.Controls.Add(Me.btnLast) | |
167 | - Me.Controls.Add(Me.txtFileName) | |
168 | - Me.Controls.Add(Me.btnFileOpen) | |
169 | - Me.Controls.Add(Me.btnBack) | |
170 | - Me.Controls.Add(Me.btnNext) | |
171 | 239 | Me.Name = "frmOperation" |
172 | 240 | Me.Text = "Form2" |
173 | 241 | Me.GroupBox1.ResumeLayout(False) |
174 | 242 | Me.GroupBox1.PerformLayout() |
243 | + Me.tbcFileOpes.ResumeLayout(False) | |
244 | + Me.tpAdobePDF.ResumeLayout(False) | |
245 | + Me.tpAdobePDF.PerformLayout() | |
246 | + Me.tpMediaPlayer.ResumeLayout(False) | |
247 | + Me.tpMediaPlayer.PerformLayout() | |
175 | 248 | Me.ResumeLayout(False) |
176 | - Me.PerformLayout() | |
177 | 249 | |
178 | 250 | End Sub |
179 | 251 | |
180 | - Friend WithEvents btnNext As Windows.Forms.Button | |
181 | - Friend WithEvents btnBack As Windows.Forms.Button | |
182 | - Friend WithEvents btnFileOpen As Windows.Forms.Button | |
183 | - Friend WithEvents txtFileName As Windows.Forms.TextBox | |
252 | + Friend WithEvents btnPDFNext As Windows.Forms.Button | |
253 | + Friend WithEvents btnPDFBack As Windows.Forms.Button | |
254 | + Friend WithEvents btnOpenPDFFile As Windows.Forms.Button | |
255 | + Friend WithEvents txtPDFFileName As Windows.Forms.TextBox | |
184 | 256 | Friend WithEvents OpenFileDialog1 As Windows.Forms.OpenFileDialog |
185 | - Friend WithEvents btnLast As Windows.Forms.Button | |
186 | - Friend WithEvents btnFirst As Windows.Forms.Button | |
257 | + Friend WithEvents btnPDFLast As Windows.Forms.Button | |
258 | + Friend WithEvents btnPDFFirst As Windows.Forms.Button | |
187 | 259 | Friend WithEvents cmbDisplay As Windows.Forms.ComboBox |
188 | 260 | Friend WithEvents Label1 As Windows.Forms.Label |
189 | - Friend WithEvents cmbView As Windows.Forms.ComboBox | |
261 | + Friend WithEvents cmbPDFView As Windows.Forms.ComboBox | |
190 | 262 | Friend WithEvents Label2 As Windows.Forms.Label |
191 | - Friend WithEvents btnFileClose As Windows.Forms.Button | |
263 | + Friend WithEvents btnPDFFileClose As Windows.Forms.Button | |
192 | 264 | Friend WithEvents GroupBox1 As Windows.Forms.GroupBox |
265 | + Friend WithEvents tbcFileOpes As Windows.Forms.TabControl | |
266 | + Friend WithEvents tpAdobePDF As Windows.Forms.TabPage | |
267 | + Friend WithEvents tpMediaPlayer As Windows.Forms.TabPage | |
268 | + Friend WithEvents btnOpenMediaFile As Windows.Forms.Button | |
269 | + Friend WithEvents btnStartStop As Windows.Forms.Button | |
270 | + Friend WithEvents txtMediaFileName As Windows.Forms.TextBox | |
193 | 271 | End Class |
@@ -7,23 +7,24 @@ | ||
7 | 7 | Public Property frmView As frmView |
8 | 8 | Public Property axPDF As AxAcroPDFLib.AxAcroPDF |
9 | 9 | |
10 | - Private Sub Form2_Load(sender As Object, e As EventArgs) Handles MyBase.Load | |
10 | + Private Sub frmOperation_Load(sender As Object, e As EventArgs) Handles MyBase.Load | |
11 | 11 | screenDetect() |
12 | 12 | AppSettingLoad() |
13 | 13 | End Sub |
14 | 14 | |
15 | 15 | |
16 | + | |
16 | 17 | #Region "設定値" |
17 | 18 | Private Sub AppSettingLoad() |
18 | 19 | |
19 | 20 | cmbDisplay.SelectedIndex = My.Settings.cmbDisplaySelectedIndex |
20 | - cmbView.SelectedIndex = My.Settings.cmbView | |
21 | + cmbPDFView.SelectedIndex = My.Settings.cmbView | |
21 | 22 | End Sub |
22 | 23 | |
23 | 24 | Private Sub AppSettingSave() |
24 | 25 | |
25 | 26 | My.Settings.cmbDisplaySelectedIndex = cmbDisplay.SelectedIndex |
26 | - My.Settings.cmbView = cmbView.SelectedIndex | |
27 | + My.Settings.cmbView = cmbPDFView.SelectedIndex | |
27 | 28 | My.Settings.Save() |
28 | 29 | End Sub |
29 | 30 |
@@ -37,40 +38,95 @@ | ||
37 | 38 | End Sub |
38 | 39 | #End Region |
39 | 40 | |
40 | -#Region "ページの移動操作" | |
41 | +#Region "終了処理" | |
41 | 42 | |
42 | - Private Sub btnFirst_Click(sender As Object, e As EventArgs) Handles btnFirst.Click | |
43 | + Private Sub frmOperation_FormClosed(sender As Object, e As FormClosedEventArgs) Handles MyBase.FormClosed | |
44 | + AppSettingSave() | |
45 | + frmView.Close() | |
46 | + End Sub | |
47 | +#End Region | |
48 | + | |
49 | +#Region "フォームをセカンドディスプレイに表示" | |
50 | + Private Sub cmbDisplay_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cmbDisplay.SelectedIndexChanged | |
51 | + If cmbDisplay.SelectedIndex < 0 Then | |
52 | + Exit Sub | |
53 | + End If | |
54 | + If cmbDisplay.SelectedItem Is Nothing Then | |
55 | + Exit Sub | |
56 | + End If | |
57 | + 'フォームを表示するディスプレイのScreenを取得する | |
58 | + Dim s As Screen = DirectCast(Me.cmbDisplay.SelectedItem, Screen) | |
59 | + 'フォームの開始位置をディスプレイの左上座標に設定する | |
60 | + frmView.StartPosition = FormStartPosition.Manual | |
61 | + frmView.Location = s.Bounds.Location | |
62 | + frmView.Size = s.Bounds.Size | |
63 | + | |
64 | + End Sub | |
65 | + | |
66 | + | |
67 | + | |
68 | + | |
69 | + | |
70 | +#End Region | |
71 | + | |
72 | +#Region "Adobe PDF Reader の 処理" | |
73 | + | |
74 | +#Region "ページ移動" | |
75 | + | |
76 | + Private Sub btnFirst_Click(sender As Object, e As EventArgs) Handles btnPDFFirst.Click | |
43 | 77 | axPDF.gotoFirstPage() |
44 | 78 | End Sub |
45 | 79 | |
46 | - Private Sub btnNext_Click(sender As Object, e As EventArgs) Handles btnNext.Click | |
80 | + Private Sub btnNext_Click(sender As Object, e As EventArgs) Handles btnPDFNext.Click | |
47 | 81 | axPDF.gotoNextPage() |
48 | 82 | End Sub |
49 | 83 | |
50 | - Private Sub btnBack_Click(sender As Object, e As EventArgs) Handles btnBack.Click | |
84 | + Private Sub btnBack_Click(sender As Object, e As EventArgs) Handles btnPDFBack.Click | |
51 | 85 | axPDF.gotoPreviousPage() |
52 | 86 | End Sub |
53 | 87 | |
54 | - Private Sub btnLast_Click(sender As Object, e As EventArgs) Handles btnLast.Click | |
88 | + Private Sub btnLast_Click(sender As Object, e As EventArgs) Handles btnPDFLast.Click | |
55 | 89 | axPDF.gotoLastPage() |
56 | 90 | End Sub |
57 | 91 | |
58 | 92 | #End Region |
59 | 93 | |
60 | -#Region "ファイルを開く" | |
94 | + ''' <summary> | |
95 | + ''' ページのおさまり表示の変更 | |
96 | + ''' </summary> | |
97 | + ''' <param name="sender"></param> | |
98 | + ''' <param name="e"></param> | |
99 | + Private Sub cmbView_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cmbPDFView.SelectedIndexChanged | |
100 | + axPDF.setView(cmbPDFView.Text) | |
101 | + End Sub | |
102 | + | |
103 | + ''' <summary> | |
104 | + ''' PDFを閉じる | |
105 | + ''' </summary> | |
106 | + ''' <param name="sender"></param> | |
107 | + ''' <param name="e"></param> | |
108 | + Private Sub btnFileClose_Click(sender As Object, e As EventArgs) Handles btnPDFFileClose.Click | |
109 | + txtPDFFileName.Text = String.Empty | |
110 | + End Sub | |
111 | + | |
112 | + | |
113 | + | |
114 | +#Region "PDFファイルを開く" | |
61 | 115 | Private backFileName As String |
62 | - Private Sub btnFileOpen_Click(sender As Object, e As EventArgs) Handles btnFileOpen.Click | |
116 | + Private Sub btnFileOpen_Click(sender As Object, e As EventArgs) Handles btnOpenPDFFile.Click | |
117 | + OpenFileDialog1.Filter = "PDFファイル (*.pdf) |*.pdf" | |
118 | + OpenFileDialog1.Filter = txtPDFFileName.Text | |
63 | 119 | Dim ret = OpenFileDialog1.ShowDialog() |
64 | 120 | If ret = Windows.Forms.DialogResult.Cancel Then |
65 | 121 | Exit Sub |
66 | 122 | End If |
67 | - 'todo : pdfではなかったときの処理 | |
68 | - txtFileName.Text = OpenFileDialog1.FileName | |
69 | 123 | |
124 | + txtPDFFileName.Text = OpenFileDialog1.FileName | |
125 | + | |
70 | 126 | End Sub |
71 | 127 | |
72 | - Private Sub txtFileName_TextChanged(sender As Object, e As EventArgs) Handles txtFileName.TextChanged | |
73 | - If txtFileName.Text = String.Empty Then | |
128 | + Private Sub txtFileName_TextChanged(sender As Object, e As EventArgs) Handles txtPDFFileName.TextChanged | |
129 | + If txtPDFFileName.Text = String.Empty Then | |
74 | 130 | 'ファイルを閉じることはできないので非表示にしている。 |
75 | 131 | frmView.pnlCover.Visible = True |
76 | 132 |
@@ -77,50 +133,44 @@ | ||
77 | 133 | Return |
78 | 134 | End If |
79 | 135 | frmView.pnlCover.Visible = False |
80 | - If backFileName = txtFileName.Text Then | |
136 | + If backFileName = txtPDFFileName.Text Then | |
81 | 137 | Return |
82 | 138 | End If |
83 | 139 | axPDF.Visible = True |
84 | - axPDF.LoadFile(txtFileName.Text) | |
85 | - backFileName = txtFileName.Text | |
140 | + axPDF.LoadFile(txtPDFFileName.Text) | |
141 | + 'todo : pdfが開けなかったときの処理 | |
142 | + backFileName = txtPDFFileName.Text | |
86 | 143 | axPDF.setShowToolbar(False) |
87 | 144 | axPDF.setShowScrollbars(False) |
88 | 145 | End Sub |
89 | 146 | |
90 | -#End Region | |
91 | -#Region "フォームをセカンドディスプレイに表示" | |
92 | - Private Sub ComboBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cmbDisplay.SelectedIndexChanged | |
93 | - If cmbDisplay.SelectedIndex < 0 Then | |
94 | - Exit Sub | |
95 | - End If | |
96 | - If cmbDisplay.SelectedItem Is Nothing Then | |
97 | - Exit Sub | |
98 | - End If | |
99 | - 'フォームを表示するディスプレイのScreenを取得する | |
100 | - Dim s As Screen = DirectCast(Me.cmbDisplay.SelectedItem, Screen) | |
101 | - 'フォームの開始位置をディスプレイの左上座標に設定する | |
102 | - frmView.StartPosition = FormStartPosition.Manual | |
103 | - frmView.Location = s.Bounds.Location | |
104 | - frmView.Size = s.Bounds.Size | |
105 | 147 | |
106 | - End Sub | |
107 | 148 | |
149 | +#End Region | |
150 | +#End Region | |
108 | 151 | |
152 | +#Region "Media Playerの処理" | |
109 | 153 | |
110 | - Private Sub cmbView_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cmbView.SelectedIndexChanged | |
111 | - axPDF.setView(cmbView.Text) | |
112 | - End Sub | |
154 | + Private inPlay As Boolean = False | |
155 | + Private Sub btnOpenMediaFile_Click(sender As Object, e As EventArgs) Handles btnOpenMediaFile.Click | |
156 | + OpenFileDialog1.Filter = "映像ファイル (*.wmv) |*.wmv" | |
157 | + OpenFileDialog1.Filter = txtMediaFileName.Text | |
158 | + Dim ret = OpenFileDialog1.ShowDialog() | |
159 | + If ret = Windows.Forms.DialogResult.Cancel Then | |
160 | + Exit Sub | |
161 | + End If | |
113 | 162 | |
114 | - Private Sub frmOperation_FormClosed(sender As Object, e As FormClosedEventArgs) Handles MyBase.FormClosed | |
115 | - AppSettingSave() | |
116 | - frmView.Close() | |
163 | + txtMediaFileName.Text = OpenFileDialog1.FileName | |
117 | 164 | End Sub |
118 | 165 | |
119 | - Private Sub btnFileClose_Click(sender As Object, e As EventArgs) Handles btnFileClose.Click | |
120 | - txtFileName.Text = String.Empty | |
166 | + Private Sub btnStartStop_Click(sender As Object, e As EventArgs) Handles btnStartStop.Click | |
167 | + inPlay = Not inPlay | |
168 | + If inPlay Then | |
169 | + btnStartStop.Text = "停止する" | |
170 | + Else | |
171 | + btnStartStop.Text = "再生する" | |
172 | + End If | |
121 | 173 | End Sub |
122 | - | |
123 | - | |
124 | 174 | #End Region |
125 | 175 | |
126 | 176 |