タイトル : showdialog画面より最前面 投稿日 : 2009/09/09(Wed) 10:04 投稿者 : VB
VB2008 WinXP 下記のプログラムのようにスレッドで表示したForm2画面の上に フォルダ選択画面を表示させたいのですが。 どのようにすれば、フォルダ選択画面が最前面にもっていけるでしょうか? アドバイス宜しくお願い致します。 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click On Error Resume Next Dim th As New Threading.Thread(AddressOf openform) th.Start() Dim oShell As Object Dim oFolder As Object oShell = CreateObject("Shell.Application") oFolder = oShell.BrowseForFolder(0, "フォルダを選択してください。", 1, "A:\") If Not (oFolder Is Nothing) Then MsgBox(oFolder.Items.Item.Path()) Else MsgBox("キャンセル") End If End Sub Private Sub openform() On Error Resume Next Form2.ShowDialog() End Sub |