• R/O
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

デュアルディスプレイのセカンドモニターにPDF、動画、画像を表示。


Commit MetaInfo

Revision10 (tree)
Time2017-10-22 18:09:03
Authorbellyoshi

Log Message

Change Summary

Incremental Difference

--- pdfsecondmonitor/frmOperation.Designer.vb (revision 9)
+++ pdfsecondmonitor/frmOperation.Designer.vb (revision 10)
@@ -22,79 +22,87 @@
2222 'コード エディターを使って変更しないでください。
2323 <System.Diagnostics.DebuggerStepThrough()> _
2424 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()
2929 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()
3232 Me.cmbDisplay = New System.Windows.Forms.ComboBox()
3333 Me.Label1 = New System.Windows.Forms.Label()
34- Me.cmbView = New System.Windows.Forms.ComboBox()
34+ Me.cmbPDFView = New System.Windows.Forms.ComboBox()
3535 Me.Label2 = New System.Windows.Forms.Label()
36- Me.btnFileClose = New System.Windows.Forms.Button()
36+ Me.btnPDFFileClose = New System.Windows.Forms.Button()
3737 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()
3844 Me.GroupBox1.SuspendLayout()
45+ Me.tbcFileOpes.SuspendLayout()
46+ Me.tpAdobePDF.SuspendLayout()
47+ Me.tpMediaPlayer.SuspendLayout()
3948 Me.SuspendLayout()
4049 '
41- 'btnNext
50+ 'btnPDFNext
4251 '
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
4958 '
50- 'btnBack
59+ 'btnPDFBack
5160 '
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
5867 '
59- 'btnFileOpen
68+ 'btnOpenPDFFile
6069 '
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
6776 '
68- 'txtFileName
77+ 'txtPDFFileName
6978 '
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
7584 '
7685 'OpenFileDialog1
7786 '
7887 Me.OpenFileDialog1.FileName = "OpenFileDialog1"
79- Me.OpenFileDialog1.Filter = "PDFファイル (*.pdf) |*.pdf"
8088 '
81- 'btnLast
89+ 'btnPDFLast
8290 '
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
8997 '
90- 'btnFirst
98+ 'btnPDFFirst
9199 '
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
98106 '
99107 'cmbDisplay
100108 '
@@ -114,33 +122,33 @@
114122 Me.Label1.TabIndex = 7
115123 Me.Label1.Text = "表示するディスプレイ"
116124 '
117- 'cmbView
125+ 'cmbPDFView
118126 '
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
126134 '
127135 'Label2
128136 '
129137 Me.Label2.AutoSize = True
130- Me.Label2.Location = New System.Drawing.Point(19, 223)
138+ Me.Label2.Location = New System.Drawing.Point(33, 144)
131139 Me.Label2.Name = "Label2"
132140 Me.Label2.Size = New System.Drawing.Size(59, 15)
133141 Me.Label2.TabIndex = 9
134142 Me.Label2.Text = "SetView"
135143 '
136- 'btnFileClose
144+ 'btnPDFFileClose
137145 '
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
144152 '
145153 'GroupBox1
146154 '
@@ -153,41 +161,111 @@
153161 Me.GroupBox1.TabStop = False
154162 Me.GroupBox1.Text = "設定"
155163 '
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+ '
156232 'frmOperation
157233 '
158234 Me.AutoScaleDimensions = New System.Drawing.SizeF(8.0!, 15.0!)
159235 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)
161238 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)
171239 Me.Name = "frmOperation"
172240 Me.Text = "Form2"
173241 Me.GroupBox1.ResumeLayout(False)
174242 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()
175248 Me.ResumeLayout(False)
176- Me.PerformLayout()
177249
178250 End Sub
179251
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
184256 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
187259 Friend WithEvents cmbDisplay As Windows.Forms.ComboBox
188260 Friend WithEvents Label1 As Windows.Forms.Label
189- Friend WithEvents cmbView As Windows.Forms.ComboBox
261+ Friend WithEvents cmbPDFView As Windows.Forms.ComboBox
190262 Friend WithEvents Label2 As Windows.Forms.Label
191- Friend WithEvents btnFileClose As Windows.Forms.Button
263+ Friend WithEvents btnPDFFileClose As Windows.Forms.Button
192264 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
193271 End Class
--- pdfsecondmonitor/frmOperation.vb (revision 9)
+++ pdfsecondmonitor/frmOperation.vb (revision 10)
@@ -7,23 +7,24 @@
77 Public Property frmView As frmView
88 Public Property axPDF As AxAcroPDFLib.AxAcroPDF
99
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
1111 screenDetect()
1212 AppSettingLoad()
1313 End Sub
1414
1515
16+
1617 #Region "設定値"
1718 Private Sub AppSettingLoad()
1819
1920 cmbDisplay.SelectedIndex = My.Settings.cmbDisplaySelectedIndex
20- cmbView.SelectedIndex = My.Settings.cmbView
21+ cmbPDFView.SelectedIndex = My.Settings.cmbView
2122 End Sub
2223
2324 Private Sub AppSettingSave()
2425
2526 My.Settings.cmbDisplaySelectedIndex = cmbDisplay.SelectedIndex
26- My.Settings.cmbView = cmbView.SelectedIndex
27+ My.Settings.cmbView = cmbPDFView.SelectedIndex
2728 My.Settings.Save()
2829 End Sub
2930
@@ -37,40 +38,95 @@
3738 End Sub
3839 #End Region
3940
40-#Region "ページの移動操作"
41+#Region "終了処理"
4142
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
4377 axPDF.gotoFirstPage()
4478 End Sub
4579
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
4781 axPDF.gotoNextPage()
4882 End Sub
4983
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
5185 axPDF.gotoPreviousPage()
5286 End Sub
5387
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
5589 axPDF.gotoLastPage()
5690 End Sub
5791
5892 #End Region
5993
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ファイルを開く"
61115 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
63119 Dim ret = OpenFileDialog1.ShowDialog()
64120 If ret = Windows.Forms.DialogResult.Cancel Then
65121 Exit Sub
66122 End If
67- 'todo : pdfではなかったときの処理
68- txtFileName.Text = OpenFileDialog1.FileName
69123
124+ txtPDFFileName.Text = OpenFileDialog1.FileName
125+
70126 End Sub
71127
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
74130 'ファイルを閉じることはできないので非表示にしている。
75131 frmView.pnlCover.Visible = True
76132
@@ -77,50 +133,44 @@
77133 Return
78134 End If
79135 frmView.pnlCover.Visible = False
80- If backFileName = txtFileName.Text Then
136+ If backFileName = txtPDFFileName.Text Then
81137 Return
82138 End If
83139 axPDF.Visible = True
84- axPDF.LoadFile(txtFileName.Text)
85- backFileName = txtFileName.Text
140+ axPDF.LoadFile(txtPDFFileName.Text)
141+ 'todo : pdfが開けなかったときの処理
142+ backFileName = txtPDFFileName.Text
86143 axPDF.setShowToolbar(False)
87144 axPDF.setShowScrollbars(False)
88145 End Sub
89146
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
105147
106- End Sub
107148
149+#End Region
150+#End Region
108151
152+#Region "Media Playerの処理"
109153
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
113162
114- Private Sub frmOperation_FormClosed(sender As Object, e As FormClosedEventArgs) Handles MyBase.FormClosed
115- AppSettingSave()
116- frmView.Close()
163+ txtMediaFileName.Text = OpenFileDialog1.FileName
117164 End Sub
118165
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
121173 End Sub
122-
123-
124174 #End Region
125175
126176