Click here to Skip to main content
15,905,232 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Session Out problem Pin
NidhiKanu5-Jan-09 2:41
professionalNidhiKanu5-Jan-09 2:41 
GeneralRe: Session Out problem Pin
Dave Kreskowiak5-Jan-09 4:00
mveDave Kreskowiak5-Jan-09 4:00 
QuestionVisual Basic 2008 Express Edition: Retrieve emails from POP3 server Pin
helen004-Jan-09 17:50
helen004-Jan-09 17:50 
AnswerRe: Visual Basic 2008 Express Edition: Retrieve emails from POP3 server Pin
NidhiKanu4-Jan-09 20:19
professionalNidhiKanu4-Jan-09 20:19 
AnswerRe: Visual Basic 2008 Express Edition: Retrieve emails from POP3 server Pin
Bharat Jain5-Jan-09 1:13
Bharat Jain5-Jan-09 1:13 
AnswerRe: Visual Basic 2008 Express Edition: Retrieve emails from POP3 server Pin
Ashfield5-Jan-09 1:32
Ashfield5-Jan-09 1:32 
QuestionWebBrowser Drag and Drop Pin
StuBaum4-Jan-09 11:28
StuBaum4-Jan-09 11:28 
AnswerRe: WebBrowser Drag and Drop Pin
StuBaum14-Jan-09 8:21
StuBaum14-Jan-09 8:21 
Well... Nobody has answered my question so let me explain how I overcame the webbrowsers controls drag and drop issues. I created a transparent control (TCtl) that I placed over the webbrowser control I added handlers for dragenter and dragdrop for TCtl. I parsed the dropped html info to retrieve all of the images url's & then downloaded the images to a localdrive & replaced the href in the html to point to the local images. I then saved the html to a file. I could then load the file into the webbrowser control. Slicker than a rats ass if I may say so. Some of the code is shown below.

For saving the images....

Source = web url, Dest = local drive....

Private Sub GetWebFile(ByVal strSource As String, ByVal strDest As String)
Dim WebConnection As New WebClient()
Try
If File.Exists(strDest) Then File.Delete(strDest)
WebConnection.DownloadFile(strSource, strDest)
Catch ex As Exception
MsgBox("Error retrieving web file", ex.Message)
End Try
End Sub

For the drag and drop from a webpage (not complete)....

Private Sub TCtlDragEnter(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs)
e.Effect = DragDropEffects.Copy
If e.Data.GetDataPresent(DataFormats.Html) Then
TCtlDropFormat = "HTML"
ElseIf e.Data.GetDataPresent(DataFormats.FileDrop) Then
TCtlDropFormat = "File"
ElseIf e.Data.GetDataPresent(DataFormats.Bitmap) Then
TCtlDropFormat = "Bitmap"
ElseIf e.Data.GetDataPresent(DataFormats.Text) Then
TCtlDropFormat = "Text"
Else
e.Effect = DragDropEffects.None
End If
End Sub

Private Sub TCtlDragDrop(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs)
Select Case TCtlDropFormat
Case "HTML"
Dim strData As String = e.Data.GetData(DataFormats.Html)
DoHTMLDrop(strData)
Case "File"
Stop
Case "Bitmap"
Stop
Case "Text"
Stop
End Select
End Sub

For the transparent control....

Public DWBSTCtl As New TransparentCtl

DWBSTCtl.Left = 0
DWBSTCtl.Top = 0
DWBSTCtl.Width = wbData.Width - 20
DWBSTCtl.Height = wbData.Height
DWBSTCtl.AllowDrop = True
AddHandler DWBSTCtl.DragEnter, AddressOf TCtlDragEnter
AddHandler DWBSTCtl.DragDrop, AddressOf TCtlDragDrop
tabData.Controls.Add(DWBSTCtl)
DWBSTCtl.Dock = DockStyle.None
DWBSTCtl.BringToFront()

I found this code somewhere, maybe here, don't know who to give credit to - but he is a better programmer than me.

Public Class TransparentCtl
Inherits Control

Protected Overrides ReadOnly Property CreateParams() As System.Windows.Forms.CreateParams
Get
' Make the control transparent.
Dim MyParams As CreateParams = MyBase.CreateParams()
MyParams.ExStyle = MyParams.ExStyle Or &H20
Return MyParams
End Get
End Property

Protected Overrides Sub OnPaintBackground(ByVal pevent As System.Windows.Forms.PaintEventArgs)
' Do nothing (because we want to be transparent).
End Sub

Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)

End Sub

End Class


Why am I doing this? My app is an inventory/invoice app that has data sheets and FAQ sheets for the items in the inventory. I needed a way for the user populate these sheets with info. They can now go to the item manufactures website & cut, paste, drag, drop from the webpage relevant info. Depending on the type of info dropped I will display the suitable control to display it. RTF, HTML or Text. THANKS to all that spent time thinking of ways to help it would of been nice to get your ideas cuz I was runnin on empty before the transparent control idea finally came to me in the middle of the night.
QuestionHow to create forms in background worker thread in vb.net Pin
sohaib_a4-Jan-09 7:18
sohaib_a4-Jan-09 7:18 
AnswerRe: How to create forms in background worker thread in vb.net Pin
Naji El Kotob4-Jan-09 11:32
Naji El Kotob4-Jan-09 11:32 
GeneralRe: How to create forms in background worker thread in vb.net Pin
sohaib_a4-Jan-09 19:02
sohaib_a4-Jan-09 19:02 
GeneralRe: How to create forms in background worker thread in vb.net Pin
Guffa4-Jan-09 19:42
Guffa4-Jan-09 19:42 
QuestionVBscript Pin
oburaochola4-Jan-09 5:50
oburaochola4-Jan-09 5:50 
AnswerRe: VBscript Pin
Colin Angus Mackay4-Jan-09 5:51
Colin Angus Mackay4-Jan-09 5:51 
AnswerRe: VBscript Pin
Eddy Vluggen7-Jan-09 0:49
professionalEddy Vluggen7-Jan-09 0:49 
QuestionVB Script Project Pin
oburaochola4-Jan-09 4:22
oburaochola4-Jan-09 4:22 
AnswerRe: VB homework assignment Pin
Guffa4-Jan-09 4:49
Guffa4-Jan-09 4:49 
GeneralRe: VB homework assignment Pin
oburaochola4-Jan-09 6:07
oburaochola4-Jan-09 6:07 
GeneralRe: VB homework assignment Pin
Guffa4-Jan-09 19:33
Guffa4-Jan-09 19:33 
QuestionShow form from dll? Pin
andyr20053-Jan-09 17:50
andyr20053-Jan-09 17:50 
AnswerRe: Show form from dll? Pin
dan!sh 3-Jan-09 22:54
professional dan!sh 3-Jan-09 22:54 
AnswerRe: Show form from dll? Pin
Jon_Boy4-Jan-09 5:21
Jon_Boy4-Jan-09 5:21 
QuestionClose file open as an image in Picturebox Pin
Amanjot3-Jan-09 17:32
Amanjot3-Jan-09 17:32 
AnswerRe: Close file open as an image in Picturebox Pin
Dave Kreskowiak4-Jan-09 0:13
mveDave Kreskowiak4-Jan-09 0:13 
GeneralRe: Close file open as an image in Picturebox Pin
Jon_Boy4-Jan-09 5:25
Jon_Boy4-Jan-09 5:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.