You are here:

C#/add images and video to dictionary program in c#

Advertisement


Question
Dear sir
i work on a bilingual dictionary in c# that have a database in
text format(notepad).i want add images and video for a few words.i want add 2 button on dictionary form for images and video files . if a word have a image or video the buttons should be enable otherwise disable.please help me and if you khow address of a source code same as this program guide me.
tnx

tnx


Answer
I'm not quite sure what your question is, but I'll try my best to answer any I think you're asking.

You can get a button to be disabled/enabled programmatically. Here is the code for that:

if(word.hasImage) {
   btnImage.Enabled = false;
} else {
   btnImage.Enabled = true;
}

// Do the same for the video button.


Now, in order to display an image, you can create a form with an image control in it. I forget what the control is called exactly... ImageBox or PictureBox or something like that (you'll see it in the Visual Studio tool box). I'm not sure how to display a video. If that is indeed one of your questions, get back to me and I'll look into it for you.

If you need help on storing information about an image or a video in your database, just store relative paths to the image/video files. If you have an image for "elephant", you might store that in the images folder with the name "elephant.jpg". So, in your database, depending on how it is structured, you might have something like this (assuming you use an XML text format):

<word english="elephant" spanish="elephante">
   <definition>
       <english>
           A big gray animal with a trunk and which never forgets.
       </english>
   </definition>
   <image src="images/elephant.jpg">
</word>

Good Luck,
   Nick

C#

All Answers


Answers by Expert:


Ask Experts

Volunteer


Nick

Expertise

I can answer questions regarding C#, C++, SQL, Visual Basic, .Net Framework 2.0, general programming technique, and general algorithm development. My current area of focus is C#.

Experience

C++/VB programmer since 10th grade. I used to love video game development (still do, just don't do it anymore). Have real world experience in 4 companies for a total of about 4 years non-academic experience.

Organizations
Innotrac (we deal with order fulfillment)

Publications
CodeProject.com

Education/Credentials
BS in Computer Science with minor in Entertainment Technology.

Awards and Honors
"The Next Bill Gates" gag award :-). College: Summa Cum Laude.

©2012 About.com, a part of The New York Times Company. All rights reserved.