Click here to Skip to main content
15,917,612 members
Home / Discussions / C#
   

C#

 
GeneralRe: Can some one tell my why this doesnt want to seem to work Pin
Eddy Vluggen27-Feb-09 9:07
professionalEddy Vluggen27-Feb-09 9:07 
GeneralRe: Can some one tell my why this doesnt want to seem to work Pin
Ronin11427-Feb-09 11:14
Ronin11427-Feb-09 11:14 
GeneralRe: Can some one tell my why this doesnt want to seem to work Pin
Eddy Vluggen27-Feb-09 22:28
professionalEddy Vluggen27-Feb-09 22:28 
GeneralRe: Can some one tell my why this doesnt want to seem to work Pin
Ronin11428-Feb-09 7:07
Ronin11428-Feb-09 7:07 
Questiondatabase design for 2waysms Pin
shobansama26-Feb-09 22:01
shobansama26-Feb-09 22:01 
AnswerRe: database design for 2waysms Pin
Eddy Vluggen26-Feb-09 22:24
professionalEddy Vluggen26-Feb-09 22:24 
Question[Message Deleted] Pin
Abhishek Rana26-Feb-09 20:29
Abhishek Rana26-Feb-09 20:29 
AnswerRe: about the re-encode the video Pin
Expert Coming26-Feb-09 20:49
Expert Coming26-Feb-09 20:49 
Questionwater mark on video file Pin
Abhishek Rana26-Feb-09 20:12
Abhishek Rana26-Feb-09 20:12 
AnswerRe: water mark on video file Pin
Christian Graus26-Feb-09 20:17
protectorChristian Graus26-Feb-09 20:17 
GeneralRe: water mark on video file Pin
Nishant Betawar13-Dec-13 21:40
Nishant Betawar13-Dec-13 21:40 
GeneralRe: water mark on video file Pin
Christian Graus13-Dec-13 22:44
protectorChristian Graus13-Dec-13 22:44 
GeneralRe: water mark on video file Pin
Nishant Betawar16-Dec-13 20:43
Nishant Betawar16-Dec-13 20:43 
GeneralRe: water mark on video file Pin
Christian Graus16-Dec-13 21:19
protectorChristian Graus16-Dec-13 21:19 
Question[Message Deleted] Pin
Prajeesh26-Feb-09 20:05
Prajeesh26-Feb-09 20:05 
AnswerRe: Open PDF in RichTextBox Pin
Christian Graus26-Feb-09 20:17
protectorChristian Graus26-Feb-09 20:17 
Question[Message Deleted] Pin
Prajeesh27-Feb-09 0:27
Prajeesh27-Feb-09 0:27 
AnswerRe: Open PDF in RichTextBox Pin
Calin Tatar27-Feb-09 0:47
Calin Tatar27-Feb-09 0:47 
Questionconverting Pin
kanthgadu26-Feb-09 20:00
kanthgadu26-Feb-09 20:00 
AnswerRe: converting Pin
Christian Graus26-Feb-09 20:16
protectorChristian Graus26-Feb-09 20:16 
AnswerRe: converting Pin
Shyam K Pananghat26-Feb-09 20:30
Shyam K Pananghat26-Feb-09 20:30 
QuestionWMI service causes strange behaviour Pin
shabya26-Feb-09 19:59
shabya26-Feb-09 19:59 
AnswerRe: WMI service causes strange behaviour Pin
Calin Tatar26-Feb-09 22:32
Calin Tatar26-Feb-09 22:32 
GeneralRe: WMI service causes strange behaviour Pin
shabya26-Feb-09 22:43
shabya26-Feb-09 22:43 
QuestionDrag Drop listView Imagelist Images..... [modified] Pin
S K Y26-Feb-09 19:45
S K Y26-Feb-09 19:45 
Frown | :( Cry | :(( WTF | :WTF: hi i need help

im doing drag drop to listview imagelist images....selected images.my drag drop part cannot work...i tried so many type of coding but could't now im tring....creat another image list in listview 2 and add those selected items images in to that list view...i can add item text but cannot add image....anyone if can pl help me.....

thanks a lot here is my code...
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;

namespace Project_import_1
{
    public partial class ImportForm : Form
    {
        public ImportForm()
        {
            InitializeComponent();
        }
        OpenFileDialog dlg = new OpenFileDialog();
        

        private void import(object sender, EventArgs e)
        {            
            ImageList imageList = new ImageList();
            imageList.ImageSize = new Size(100, 80);
            imageList.ColorDepth = ColorDepth.Depth32Bit;

            int i = 0;
            string[] files = dlg.FileNames;
            string[] pathes = new string[files.Length];

            foreach (string file in files)
            {
                pathes[i] = file;
                i++;
            }

            foreach (string path in pathes)
            {
                //Image img1 = Image.FromFile(path);
                //imageList.Images.Add(getThumbnaiImage   (imageList.ImageSize.Width, img1));
                imageList.Images.Add(Bitmap.FromFile(path));
                FileInfo fileInfo = new FileInfo(path);
                String strDir = fileInfo.Name;
                listView1.Items.Add(strDir);
                listView1.TileSize = new System.Drawing.Size(100, 80);

            }
            for (int j = 0; j < pathes.Length; j++)
            {
                //this.listView1.Items.Add("Picture"+(j+1));
                this.listView1.Items[j].ImageIndex = j;
            }
            this.listView1.View = View.LargeIcon;
            this.listView1.LargeImageList = imageList;

        }
        private void btnImport_Click(object sender, EventArgs e)
        {
            dlg.Filter = "All Image Files|*.bmp;*.ico;*.gif;*.jpeg;*.jpg;" +
                                "*.jfif;*.png;*.tif;*.tiff;*.wmf;*.emf|" +
                         "Windows Bitmap (*.bmp)|*.bmp|" +
                         "Windows Icon (*.ico)|*.ico|" +
                         "Graphics Interchange Format (*.gif)|*.gif|" +
                         "JPEG File Interchange Format (*.jpg)|" +
                                "*.jpg;*.jpeg;*.jfif|" +
                         "Portable Network Graphics (*.png)|*.png|" +
                         "Tag Image File Format (*.tif)|*.tif;*.tiff|" +
                         "Windows Metafile (*.wmf)|*.wmf|" +
                         "Enhanced Metafile (*.emf)|*.emf|" +
                         "All Files (*.*)|*.*";
            dlg.InitialDirectory = @"C:\Documents and Settings\All  Users\Desktop\";
            dlg.Multiselect = true;

            try
            {
                if (dlg.ShowDialog() == DialogResult.OK)
                {
                    import(sender, e);
                }
                dlg.Reset();
            }

            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
       private void listView1_ItemDrag(object sender, ItemDragEventArgs e)
        {
            
            this.listView1.DoDragDrop(this.listView1.SelectedItems[0], DragDropEffects.Copy);
        }
private void listView1_DragEnter(object sender, DragEventArgs e)
        {
            if (e.Data.GetDataPresent(typeof(ListViewItem)))
            {
                e.Effect = DragDropEffects.Copy;
            }
            else
            {
                e.Effect = DragDropEffects.None;
            }
        }
       private void listView2_DragDrop(object sender, DragEventArgs e)
        {
ListViewItem item = e.Data.GetData(typeof(ListViewItem)) as ListViewItem;
           
            this.listView2.View = View.LargeIcon;
            ImageList imageList = new ImageList();
            imageList.ImageSize = new Size(100, 100);
            imageList.ColorDepth = ColorDepth.Depth32Bit;
            int i = 0;

                     
                foreach (ListViewItem each in listView1.SelectedItems)
                { 
                    listView2.Items.Add(item.Text, item.ImageIndex);
                    
                    //imageList.Images.Add(item.ImageIndex);
                    listView2.TileSize = new System.Drawing.Size(100, 80);
                }     
            for (int j = 0; j < listView1.SelectedItems.Count; j++)
            {
                this.listView1.Items[j].ImageIndex = j;               
            }
            this.listView2.View = View.LargeIcon;
            this.listView2.LargeImageList = imageList;
	  }

Sigh | :sigh: WTF | :WTF: OMG | :OMG: Cry | :(( Frown | :(

modified on Friday, February 27, 2009 2:01 AM

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.