Get url of IE by draging on form

  • Thread starter Thread starter ebiweb
  • Start date Start date
E

ebiweb

hi everybody
can anyone knows how i can get the URL of a webpage by draging it on
a form?

with best,
ebiweb
 
can anyone knows how i can get the URL of a webpage by draging it on
a form?

[This suggestion assumes you've worked with drag-and-drop before and are at
least slightly familiar with the process.]

Check out the Data property of the DragEventArgs you get in the DragDrop
event. Use the GetFormats() method and loop through the results. Something
in there ought to be useful. Post the results, please!
 
can anyone knows how i can get the URL of a webpage  by draging it on
a form?

[This suggestion assumes you've worked with drag-and-drop before and are at
least slightly familiar with the process.]

Check out the Data property of the DragEventArgs you get in the DragDrop
event. Use the GetFormats() method and loop through the results. Something
in there ought to be useful. Post the results, please!



OK,thnx,i'll post the result .
 
hi all,
be more optimistic,
The Form has a TextBox,ListBox and and a Pannel
==================

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Drag2getURL
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}



private void panel1_DragEnter(object sender, DragEventArgs e)
{
e.Effect = DragDropEffects.All; // Okay
}

private void panel1_DragDrop(object sender, DragEventArgs e)
{
string[] FileList ;
listBox1.Items.Clear();

// Getting the list of all format from GetFormat and fill the
ListBox
FileList = (string[])e.Data.GetFormats();
foreach (string str in FileList)
listBox1.Items.Add(str );

//Show the Url in textBox
textBox1.Text = (string)e.Data.GetData("Text", false);
}




}
}

================

Use the "Text" format of GetData to get the URL .

ebiweb,
 
//Show the Url in textBox
textBox1.Text = (string)e.Data.GetData("Text", false);
Use the "Text" format of GetData to get the URL .

I figured it would be that simple. However, did you happen to notice any
other interesting formats in the Data object? Just wondering.
 
Back
Top