デュアルディスプレイのセカンドモニターにPDF、動画、画像を表示。
@@ -52,7 +52,7 @@ | ||
52 | 52 | Me.cmbPDFView = New System.Windows.Forms.ComboBox() |
53 | 53 | Me.btnPDFLast = New System.Windows.Forms.Button() |
54 | 54 | Me.btnPDFFirst = New System.Windows.Forms.Button() |
55 | - Me.Button1 = New System.Windows.Forms.Button() | |
55 | + Me.BackgroundWorker1 = New System.ComponentModel.BackgroundWorker() | |
56 | 56 | Me.GroupBox1.SuspendLayout() |
57 | 57 | CType(Me.nudWidth, System.ComponentModel.ISupportInitialize).BeginInit() |
58 | 58 | CType(Me.nudHeight, System.ComponentModel.ISupportInitialize).BeginInit() |
@@ -133,6 +133,9 @@ | ||
133 | 133 | Me.Label3.TabIndex = 13 |
134 | 134 | Me.Label3.Text = "高さ" |
135 | 135 | ' |
136 | + 'Timer1 | |
137 | + ' | |
138 | + ' | |
136 | 139 | 'tpMediaPlayer |
137 | 140 | ' |
138 | 141 | Me.tpMediaPlayer.Controls.Add(Me.btnOpenMediaFile) |
@@ -334,14 +337,8 @@ | ||
334 | 337 | Me.btnPDFFirst.Text = "最初へ" |
335 | 338 | Me.btnPDFFirst.UseVisualStyleBackColor = True |
336 | 339 | ' |
337 | - 'Button1 | |
340 | + 'BackgroundWorker1 | |
338 | 341 | ' |
339 | - Me.Button1.Location = New System.Drawing.Point(695, 60) | |
340 | - Me.Button1.Name = "Button1" | |
341 | - Me.Button1.Size = New System.Drawing.Size(75, 23) | |
342 | - Me.Button1.TabIndex = 13 | |
343 | - Me.Button1.Text = "Button1" | |
344 | - Me.Button1.UseVisualStyleBackColor = True | |
345 | 342 | ' |
346 | 343 | 'frmOperation |
347 | 344 | ' |
@@ -348,7 +345,6 @@ | ||
348 | 345 | Me.AutoScaleDimensions = New System.Drawing.SizeF(8.0!, 15.0!) |
349 | 346 | Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font |
350 | 347 | Me.ClientSize = New System.Drawing.Size(782, 465) |
351 | - Me.Controls.Add(Me.Button1) | |
352 | 348 | Me.Controls.Add(Me.tbcFileOpes) |
353 | 349 | Me.Controls.Add(Me.GroupBox1) |
354 | 350 | Me.Name = "frmOperation" |
@@ -395,5 +391,5 @@ | ||
395 | 391 | Friend WithEvents btnInsert As Button |
396 | 392 | Friend WithEvents lstPDFFiles As ListBox |
397 | 393 | Friend WithEvents btnDelete As Button |
398 | - Friend WithEvents Button1 As Button | |
394 | + Friend WithEvents BackgroundWorker1 As System.ComponentModel.BackgroundWorker | |
399 | 395 | End Class |
@@ -205,12 +205,9 @@ | ||
205 | 205 | 'If backFileName = txtPDFFileName.Text Then |
206 | 206 | ' Return |
207 | 207 | 'End If |
208 | - | |
209 | - frmView.LoadFile(txtPDFFileName.Text) | |
210 | - ' 'todo : pdfが開けなかったときの処理 | |
211 | - ' backFileName = txtPDFFileName.Text | |
212 | - 'axPDF.setShowToolbar(False) | |
213 | - 'axPDF.setShowScrollbars(False) | |
208 | + If Not BackgroundWorker1.IsBusy Then | |
209 | + BackgroundWorker1.RunWorkerAsync() | |
210 | + End If | |
214 | 211 | End Sub |
215 | 212 | |
216 | 213 |
@@ -285,10 +282,8 @@ | ||
285 | 282 | frmView.Width = nudWidth.Value |
286 | 283 | End Sub |
287 | 284 | |
288 | - Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click | |
289 | - axPDF.LoadFile("C:\Users\bellm\Downloads\CA-brpgm18_J.pdf") | |
290 | - End Sub | |
291 | 285 | |
286 | + | |
292 | 287 | #Region "リストボックス処理" |
293 | 288 | |
294 | 289 | Private Sub btnInsert_Click(sender As Object, e As EventArgs) Handles btnInsert.Click |
@@ -328,6 +323,40 @@ | ||
328 | 323 | txtPDFFileName.Text = fileviewinfo.fileName |
329 | 324 | nudPdfZoom.Value = fileviewinfo.zoom |
330 | 325 | End Sub |
326 | + | |
327 | + | |
328 | + | |
329 | + Delegate Sub simpleDelegate() | |
330 | + | |
331 | + Private Sub BackgroundWorker1_DoWork(sender As Object, e As System.ComponentModel.DoWorkEventArgs) Handles BackgroundWorker1.DoWork | |
332 | + Dim loadfuunc As simpleDelegate = AddressOf loadFile | |
333 | + Me.Invoke(loadfuunc) | |
334 | + Threading.Thread.Sleep(5000) | |
335 | + | |
336 | + Dim func As simpleDelegate = AddressOf hideToolBar | |
337 | + Me.Invoke(func) | |
338 | + Threading.Thread.Sleep(100) | |
339 | + | |
340 | + Dim func2 As simpleDelegate = AddressOf hideScrollbars | |
341 | + Me.Invoke(func2) | |
342 | + Threading.Thread.Sleep(100) | |
343 | + | |
344 | + | |
345 | + End Sub | |
346 | + | |
347 | + Sub hideScrollbars() | |
348 | + axPDF.setShowScrollbars(False) | |
349 | + End Sub | |
350 | + Sub loadFile() | |
351 | + frmView.LoadFile(txtPDFFileName.Text) | |
352 | + End Sub | |
353 | + Sub hideToolBar() | |
354 | + axPDF.setShowToolbar(False) | |
355 | + End Sub | |
356 | + | |
357 | + | |
358 | + | |
359 | + | |
331 | 360 | #End Region |
332 | 361 | |
333 | 362 | End Class |
\ No newline at end of file |
@@ -34,6 +34,7 @@ | ||
34 | 34 | Exit Sub |
35 | 35 | End If |
36 | 36 | Me.zoom = zoom |
37 | + | |
37 | 38 | AxAcroPDF1.setZoom(zoom) |
38 | 39 | End Sub |
39 | 40 | End Class |