Hello,
I posted this question on other forum but haven't get any usable help.
Problem is that I open explorer through my program (Shell) and drag a file to my form.
Then message box should appear which appear in back of explorer window and I would like to get message box in front of it (on top of all).
Here is minimal example:
For run it create a new project, add a new form (Form1) and add one button on it (btn_open)
Any help will be appreciated.
I posted this question on other forum but haven't get any usable help.
Problem is that I open explorer through my program (Shell) and drag a file to my form.
Then message box should appear which appear in back of explorer window and I would like to get message box in front of it (on top of all).
Here is minimal example:
For run it create a new project, add a new form (Form1) and add one button on it (btn_open)
Code:
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.AllowDrop = True
End Sub
Private Sub Form1_DragDrop(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles Me.DragDrop
If e.Data.GetDataPresent(DataFormats.FileDrop) Then
Dim Files() As String
Files = e.Data.GetData(DataFormats.FileDrop)
If Files.Length > 0 Then
If IO.File.Exists(Files(0)) Then
Dim ret As Integer = MsgBox("Would you like to upload a file?" & vbNewLine & Files(0), MsgBoxStyle.OkCancel + MsgBoxStyle.Question, "Decide please")
If ret = DialogResult.OK Then
' UploadF()
End If
End If
End If
End If
End Sub
Private Sub Form1_DragEnter(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles Me.DragEnter
If e.Data.GetDataPresent(DataFormats.FileDrop) Then
e.Effect = DragDropEffects.All
Else
e.Effect = DragDropEffects.None
End If
End Sub
Private Sub btn_open_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_open.Click
Shell("explorer c:\", AppWinStyle.NormalFocus)
End Sub
End Class