Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Capture picture in web browser 1

Status
Not open for further replies.

Jerryls

Technical User
Feb 29, 2000
11
0
0
US
Is there a way to copy a picture loaded in<br>
the web browser control to the clipboard <br>
in visual basic?<br>
<br>
Thanks<br>

 
Maybe this will work <br>
Here is an example from Help in VB6<br>
<br>
----------------------------<br>
Private Sub mnuCopy_Click ()<br>
Clipboard.Clear<br>
If TypeOf Screen.ActiveControl Is TextBox Then<br>
Clipboard.SetText Screen.ActiveControl.SelText<br>
ElseIf TypeOf Screen.ActiveControl Is ComboBox Then<br>
Clipboard.SetText Screen.ActiveControl.Text<br>
ElseIf TypeOf Screen.ActiveControl Is PictureBox _<br>
Then<br>
Clipboard.SetData Screen.ActiveControl.Picture<br>
ElseIf TypeOf Screen.ActiveControl Is ListBox Then<br>
Clipboard.SetText Screen.ActiveControl.Text<br>
Else<br>
' No action makes sense for the other controls.<br>
End If<br>
End Sub<br>
<br>
Private Sub mnuCut_Click ()<br>
' First do the same as a copy.<br>
mnuCopy_Click<br>
' Now clear contents of active control.<br>
If TypeOf Screen.ActiveControl Is TextBox Then<br>
Screen.ActiveControl.SelText = &quot;&quot;<br>
ElseIf TypeOf Screen.ActiveControl Is ComboBox Then<br>
Screen.ActiveControl.Text = &quot;&quot;<br>
ElseIf TypeOf Screen.ActiveControl Is PictureBox _<br>
Then<br>
Screen.ActiveControl.Picture = LoadPicture()<br>
ElseIf TypeOf Screen.ActiveControl Is ListBox Then<br>
Screen.ActiveControl.RemoveItem Screen.ActiveControl.ListIndex<br>
Else<br>
' No action makes sense for the other controls.<br>
End If<br>
End Sub<br>
<br>
Private Sub mnuPaste_Click ()<br>
If TypeOf Screen.ActiveControl Is TextBox Then<br>
Screen.ActiveControl.SelText = Clipboard.GetText()<br>
ElseIf TypeOf Screen.ActiveControl Is ComboBox Then<br>
Screen.ActiveControl.Text = Clipboard.GetText()<br>
ElseIf TypeOf Screen.ActiveControl Is PictureBox _<br>
Then<br>
Screen.ActiveControl.Picture = _<br>
Clipboard.GetData()<br>
ElseIf TypeOf Screen.ActiveControl Is ListBox Then<br>
Screen.ActiveControl.AddItem Clipboard.GetText()<br>
Else<br>
' No action makes sense for the other controls.<br>
End If<br>
End Sub<br>
<br>
<p> DougP<br><a href=mailto: dposton@universal1.com> dposton@universal1.com</a><br><a href= > </a><br>
 
Thanks for the reply, but I'm not<br>
still not getting any copy.<br>
I have had some success with the browser<br>
control's ExecWB command (select and copy,)<br>
but nothing shows up on the clipboard either.<br>
<br>
Jerry<br>

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top