Click here to Skip to main content
15,892,005 members
Home / Discussions / C#
   

C#

 
GeneralRe: DataGridView, DataSource and RowCount related query Pin
dan!sh 7-Jan-10 4:56
professional dan!sh 7-Jan-10 4:56 
QuestionCreate object explorer,query analyser and registered services windows Pin
tasumisra7-Jan-10 3:43
tasumisra7-Jan-10 3:43 
QuestionC# DataTable Pin
jojoba20107-Jan-10 3:18
jojoba20107-Jan-10 3:18 
AnswerRe: C# DataTable Pin
mrcooll7-Jan-10 4:50
mrcooll7-Jan-10 4:50 
AnswerRe: C# DataTable Pin
loyal ginger7-Jan-10 4:52
loyal ginger7-Jan-10 4:52 
GeneralRe: C# DataTable Pin
OriginalGriff7-Jan-10 5:23
mveOriginalGriff7-Jan-10 5:23 
AnswerRe: C# DataTable Pin
OriginalGriff7-Jan-10 5:19
mveOriginalGriff7-Jan-10 5:19 
QuestionCsharp .Net doubt [modified] Pin
djsproject7-Jan-10 2:59
djsproject7-Jan-10 2:59 
hello every1,
M new to this site so dont know how to post a query here if m wrong do correct me.M making a project in Csharp.Net on batch image processing.I can display multiple images n select it in check box but instead of checkboxes i want the thumbnail of the images to be displayed in the box.Can somebody please help.Thanks in advance......Here is the code that i coded in MS Visual Csharp 2008 express edition

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;
using System.IO;


namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {

        Dictionary<string, string> ImageList = new Dictionary<string, string>();
        public Form1()
        {
            InitializeComponent();
            SetStyle(ControlStyles.ResizeRedraw, true);
        }
        private void button3_Click(object sender, EventArgs e)
        {
            if (folderBrowserDialog1.ShowDialog() == DialogResult.OK)
            {
                DirectoryInfo FileDirectory = new DirectoryInfo(folderBrowserDialog1.SelectedPath);
                //FileInfo[] FilesFromDirectory = FileDirectory.GetFiles();
                FileInfo[] FileJpg = FileDirectory.GetFiles("*.jpg");
                FileInfo[] FileGif = FileDirectory.GetFiles("*.gif");
                FileInfo[] FileBmp = FileDirectory.GetFiles("*.bmp");
                FileInfo[] FileTif = FileDirectory.GetFiles("*.tif");
                FileInfo[] FilePng = FileDirectory.GetFiles("*.png");
                foreach (FileInfo File in FileJpg)
                {

                    ImageList.Add(File.Name, File.FullName);
                    checkedListBox1.Items.Add(File.Name);
                    
                }
                foreach (FileInfo File in FileGif)
                {
                    ImageList.Add(File.Name, File.FullName);
                    checkedListBox1.Items.Add(File.Name);
                }
                foreach (FileInfo File in FileGif)
                {
                    ImageList.Add(File.Name, File.FullName);
                    checkedListBox1.Items.Add(File.Name);
                }
                foreach (FileInfo File in FileTif)
                {
                    ImageList.Add(File.Name, File.FullName);
                    checkedListBox1.Items.Add(File.Name);
                }
                foreach (FileInfo File in FilePng)
                {
                    ImageList.Add(File.Name, File.FullName);
                    checkedListBox1.Items.Add(File.Name);
                }
           
            }
        }
        private void checkedListBox1_ItemCheck(object sender, ItemCheckEventArgs e)
        {
           /* int index = e.Index;
            pictureBox1.ImageLocation = ImageList[checkedListBox1.Items[index].ToString()].ToString();*/
            pictureBox1.ImageLocation = null;
            String s = folderBrowserDialog1.SelectedPath.ToString() + checkedListBox1.SelectedItem.ToString();
            MessageBox.Show(s.ToString());
            pictureBox1.ImageLocation = s; 
        }  
        private void Form1_Load(object sender, EventArgs e)
        {
            checkedListBox1.CheckOnClick = true;
        }

       
        private void checkedListBox1_SelectedIndexChanged_1(object sender, EventArgs e)
        {
            pictureBox1.Image = Image.FromFile(Path.Combine(folderBrowserDialog1.SelectedPath, checkedListBox1.Items[checkedListBox1.SelectedIndex].ToString()));
        }

        private void label2_Click(object sender, EventArgs e)
        {

        }
      }


modified on Thursday, January 7, 2010 9:17 AM

AnswerRe: Csharp .Net doubt Pin
Ben Fair7-Jan-10 3:03
Ben Fair7-Jan-10 3:03 
GeneralRe: Csharp .Net doubt Pin
djsproject7-Jan-10 3:08
djsproject7-Jan-10 3:08 
GeneralRe: Csharp .Net doubt Pin
#realJSOP7-Jan-10 3:17
mve#realJSOP7-Jan-10 3:17 
GeneralRe: Csharp .Net doubt Pin
dojohansen7-Jan-10 3:08
dojohansen7-Jan-10 3:08 
AnswerRe: Csharp .Net doubt Pin
dojohansen7-Jan-10 3:12
dojohansen7-Jan-10 3:12 
GeneralRe: Csharp .Net doubt Pin
djsproject7-Jan-10 3:18
djsproject7-Jan-10 3:18 
GeneralRe: Csharp .Net doubt Pin
dojohansen7-Jan-10 3:39
dojohansen7-Jan-10 3:39 
General[Message Deleted] Pin
djsproject7-Jan-10 3:26
djsproject7-Jan-10 3:26 
GeneralRe: Csharp .Net doubt Pin
djsproject7-Jan-10 3:37
djsproject7-Jan-10 3:37 
AnswerRe: Csharp .Net doubt Pin
Luc Pattyn7-Jan-10 3:39
sitebuilderLuc Pattyn7-Jan-10 3:39 
AnswerRe: Csharp .Net doubt Pin
Lutosław7-Jan-10 12:28
Lutosław7-Jan-10 12:28 
GeneralRe: Csharp .Net doubt Pin
djsproject12-Jan-10 17:28
djsproject12-Jan-10 17:28 
Questiona problem about string Pin
Erdinc277-Jan-10 2:22
Erdinc277-Jan-10 2:22 
AnswerRe: a problem about string [modified] Pin
harold aptroot7-Jan-10 2:33
harold aptroot7-Jan-10 2:33 
GeneralRe: a problem about string Pin
Erdinc277-Jan-10 2:58
Erdinc277-Jan-10 2:58 
GeneralRe: a problem about string Pin
harold aptroot7-Jan-10 3:01
harold aptroot7-Jan-10 3:01 
GeneralRe: a problem about string [modified] Pin
Erdinc277-Jan-10 3:16
Erdinc277-Jan-10 3:16 

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.