Click here to Skip to main content
       

C#

 
GeneralRe: data Set Not Coming In GridView Pinmemberjibesh2-Jan-13 0:02 
GeneralRe: data Set Not Coming In GridView PinmemberGugliMugli2-Jan-13 1:27 
GeneralRe: data Set Not Coming In GridView Pinmemberjibesh2-Jan-13 1:29 
AnswerRe: data Set Not Coming In GridView PinmvpRichard MacCutchan2-Jan-13 1:47 
GeneralRe: data Set Not Coming In GridView Pinmemberjibesh2-Jan-13 2:06 
GeneralRe: data Set Not Coming In GridView PinmemberGugliMugli2-Jan-13 2:18 
GeneralRe: data Set Not Coming In GridView PinmvpRichard MacCutchan2-Jan-13 4:15 
QuestionHow to show file association icon,one button and a progress bar on webbrowser control c# PinmemberTridip Bhattacharjee1-Jan-13 6:50 
i work with webbrowser for showing simple text. i am in situation where i want that when user drag any file on webbrowser control then i want to show a icon for that file and one progressbar and one button programmatically. i manage to show file associated icon ob richtextbox just like using
System.Drawing.Icon.ExtractAssociatedIcon(string filePath)
 
here is the code for handling file drag drop on richtextbox like below one
 
    public Form1()
        {
            InitializeComponent();
            richTextBox1.AllowDrop = true;
            //richTextBox1.EnableAutoDragDrop = true;
            this.richTextBox1.DragEnter += new DragEventHandler(richTextBox1_DragEnter);
            this.richTextBox1.DragDrop += new DragEventHandler(richTextBox1_DragDrop);
        }
    
        void richTextBox1_DragEnter(object sender, System.Windows.Forms.DragEventArgs e)
        {
            if ((e.Data.GetDataPresent(DataFormats.FileDrop)))
            {
                e.Effect = DragDropEffects.Copy;
            }
        }
        void richTextBox1_DragDrop(object sender, System.Windows.Forms.DragEventArgs e)
        {
            //Image img = default(Image);
            //img = Image.FromFile(((Array)e.Data.GetData(DataFormats.FileDrop)).GetValue(0).ToString());
            //Clipboard.SetImage(img);
    
            //this.richTextBox1.SelectionStart = 0;
            //richTextBox1.AppendText("Hello");
            //this.richTextBox1.Paste();
    
            /*
                Dim img As Image = Image.FromFile(fname)
                Clipboard.SetImage(img)
                RichTextBox1.Paste()
            */
    
            string strFilePath = ((Array)e.Data.GetData(DataFormats.FileDrop)).GetValue(0).ToString();
            Icon oIcon= System.Drawing.Icon.ExtractAssociatedIcon(strFilePath);
            Bitmap myBitmap = new Bitmap(oIcon.ToBitmap());
            Clipboard.SetDataObject(myBitmap);
            DataFormats.Format myFormat = DataFormats.GetFormat(DataFormats.Bitmap);
            richTextBox1.Text = "";
            if (richTextBox1.CanPaste(myFormat))
            {
                richTextBox1.Paste(myFormat);
                richTextBox1.AppendText("   " + System.IO.Path.GetFileName(strFilePath));
            }
            else
            {
                MessageBox.Show("The data format that you attempted site" +
                  " is not supportedby this control.");
            }
        }
 
here is one image link for your visualization purpose http://i.stack.imgur.com/5oRkt.png
i want to accomplish the same thing for webbrowser control for handing file drag drop and want to show one file associated icon and one progressbar and one button. please guide me with sample code for doing with webbrowser control. thanks
tbhattacharjee

Question"sendkeys" does not work KnightOnline Pinmemberismail2031-Dec-12 3:09 
AnswerRe: "sendkeys" does not work KnightOnline PinmvpDave Kreskowiak31-Dec-12 3:28 
GeneralRe: "sendkeys" does not work KnightOnline Pinmemberismail2031-Dec-12 3:42 
GeneralRe: "sendkeys" does not work KnightOnline PinmvpDave Kreskowiak31-Dec-12 5:38 
GeneralRe: "sendkeys" does not work KnightOnline Pinmemberismail2031-Dec-12 6:30 
GeneralRe: "sendkeys" does not work KnightOnline PinmvpDave Kreskowiak31-Dec-12 6:47 
GeneralRe: "sendkeys" does not work KnightOnline Pinmemberismail2031-Dec-12 7:35 
GeneralRe: "sendkeys" does not work KnightOnline PinmemberMarcus Kramer31-Dec-12 7:53 
GeneralRe: "sendkeys" does not work KnightOnline PinmvpDave Kreskowiak31-Dec-12 7:59 
GeneralRe: "sendkeys" does not work KnightOnline PinprotectorPete O'Hanlon31-Dec-12 9:01 
GeneralRe: "sendkeys" does not work KnightOnline Pinmemberharold aptroot31-Dec-12 12:40 
AnswerRe: "sendkeys" does not work KnightOnline PinmvpAbhinav S1-Jan-13 4:38 
AnswerRe: "sendkeys" does not work KnightOnline Pinmember ProgramFOX1-Jan-13 5:52 
AnswerIt's a game :) PinmemberEddy Vluggen1-Jan-13 6:01 
GeneralRe: It's a game :) Pinmember ProgramFOX1-Jan-13 6:05 
Generalto access latitudes and longitudes from database Pinmembernaveen 201230-Dec-12 22:28 
GeneralRe: to access latitudes and longitudes from database PinmvpOriginalGriff30-Dec-12 23:22 

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

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


Advertise | Privacy | Mobile
Web04 | 2.8.140709.1 | Last Updated 9 Jul 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid