Question How do I display Pictures

Iron23

Member
Joined
Jun 17, 2008
Messages
22
Programming Experience
Beginner
Here is the Image of what It should look like, when Selecting it will show the pic nd the two boxes.


Unfortunately It look like this when i debug. (ps. This is only a sample. My real project is on a different subject.)


So how can I make it so that when An item Is selected it shows the text, and the pictures?????????????????
 
in 4 hours I will be in bed. LOL. Lets take for example your example program. If you were setting up a text file this is what it would look like and here is where you should start the text file
  • SG
    This Guitar has an ultra thin body and 58 pickups
    Red
    HM STRAT
    This Guitar has a thin body and 23 pickups
    Blue
    Warlock
    This Guitar has an ultra thick body and 12 pickups
    Green
    Les Paul
    This Guitar has an ultra wide body and 45 pickups
    Black
just make sure it each matches meaning if you start with three rows you keep it three rows:
HM STRAT
This Guitar has a thin body and 23 pickups
Blue


don't mess up and do this
HM STRAT
This Guitar has a thin body and 23 pickups

and then start another. it will mess up the whole thing

without knowing exactly what you are putting into your program I can't tell you what to substitute. I showed how to declare arrays in last post.

unimac
 
Ok I will start making the text file now.
Ill do the text file like that. And then You'll need to show me how you did those pictures:)
 
ok, I was using items from your program but just plain forgot pics. That was my fault. Here is an updated of that same one and how you would do the pics:
  • SG
    This Guitar has an ultra thin body and 58 pickups
    Red
    guitar1.jpg
    HM STRAT
    This Guitar has a thin body and 23 pickups
    Blue
    guitar2.jpg
    Warlock
    This Guitar has an ultra thick body and 12 pickups
    Green
    guitar3.jpg
    Les Paul
    This Guitar has an ultra wide body and 45 pickups
    Black
    guitar4.jpg
the pics don't have to be .jpg they can be any supported:
.gif, .jpg, .jpeg, .bmp, .wmf, .png
 
Thanks. does that mean that it will need to have a resources file in the directory for it to run?

Im about to ditch my database prototype and do it completly as you have described.


Private _strPicName(42) As String ||||||||Does that go into the txt file? or in the program code.

And then I write them out like.

Mouse
Collection device
A device used to gather data from the user to form an interface.
mouse.GIF
HardDisk
Storage device
A non volitile metalic disk used for storage of digital information
 
this goes in program code
VB.NET:
Private _strPicName(42) As String

here is an example of the program I have if it helps:
VB.NET:
Public Class frmPresident
    'delcare array variables to store input from textfile 
    Private _strPicName(42) As String
    Private _strPresName(42) As String
    Private _strWifeName(42) As String
    Private _strBirthPlace(42) As String
    Private _intAge(42) As Integer
    Private _strTerms(42) As String
    Private _strDeathDate(42) As String
    Private _strYearEnter(42) As String
    Private _strYearExit(42) As String
    'declare variable to store image filename
    Dim filename As String
    'declare variable to store location and name of text file we are using
    Dim strLocationAndNameOfFile As String
    'Application executable path 
    Dim dirApp As String
    'Application executable path minus "\bin\" we will replace with "\Resouces\" later
    Dim dirAppModded As String

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As S


the only thing in text file will be:

  • Mouse
    Collection device
    A device used to gather data from the user to form an interface.
    mouse.GIF
    HardDisk
    Storage device
    A non volitile metalic disk used for storage of digital information
just make sure you keep it in this same order, like my last post shows or something will be in wrong place
 
At the moment I have the database which is providing all of the text I need fine.

All that I need is the pictures. Is it possible to have the database providing the text when the combobox is change and have the text file and the images folder provide the images?
If it is possible to have the database for the text and your way for the pictures what modifications to the instructions above will I need to make?


This is only because I have a very close deadline :)
 
using a database, you will run into the same problem as when you first started.

Here is a sample of what you are looking for using only a text file and it will be easier to deploy on other machines.
First image is startup:
pgmStart1.jpg


Second image is select a device:
pgmSelect.jpg


Third image is showing fields filled just like your Guitar project.
pgmShow.jpg
 
Lol Ok I think Ill try your way.

I have the access database with all of my things(text fields of Funtion, Description and classification, and name as the primary key).

Should I simply Copy this into the code onto the project?
Public Class ToolList
Private _ToolName(90) as string
Private _ToolDescription(90) as string
Private _ToolFuntion(90) as string
Private _ToolPicName(90) as string 'That should be the pic array?
Private _ToolClassification(90) as string

And then have the text file like
HD
Enter my description here
Enter funtion here
HD.JPEG
Hardware.
DVD
DEscription
Funtion
DVD.GIF
Hardware

..and so on.
 
ok, you are on the right track with the arrays. you are still thinking database. we won't be using a database with this.
 
No I am ditching the database. Althoug I am Going to Be copying all of the text out of it :S Im doing that now. Ill put it all in that format and then build the program. I might need some more help.

Thanks again
 
I have almost finished getting all the pictures.

At the moment I am Naming them in this format

Dvd
SynchronousTransmission

ect..

Should I be Naming them like

SynchronousTransmission.GIF

Despite the fact that It displays its imagetype underneath it?
 
your pics should be ok. It also seems we are in different time zones I rest when you want to code and vice-versa, anyway we'll get this knocked out. check your PM.
 
No I am ditching the database. Althoug I am Going to Be copying all of the text out of it :S Im doing that now. Ill put it all in that format and then build the program. I might need some more help.

Thanks again

I dont get it.. If you have a database and it works and you store text in it and you can retrieve it fine...

Then why dont you just store (as text) the FILENAME of the image that must be loaded, and when you show the text, also load the image, which will be in a folder called IMAGES alongside your app (becuase you design it that way so you know where all the pictures are)

This notion is no different to what unimac proposes expect he purports to use a flat text file rather than a DB which is severely more limited. You dont need to deploy access (the program) to enable your database to work on other machines, because Access is actually a front end ot a database technology called Jet. THere is no such thing as an Access Database.. it ought be called a Jet Database. All PCs (with the expception of vista64, last i heard) have Jet drivers preinstalled, so deploying an access db is as simple as copying the file along wiht your app

I genuinely and strongly do not recommend that you store your picstures IN the database file itself; they become horrendously difficult to get out and NOT work for a newbie at all. Store them on disk, store the path to them in the db and load them as appropriate
 
Thanks for responding but using the database Jet.4.0. I had several other major bugs, Which are resolved as using the txt file method I have now completed the program. All I need to do now Is make a startup form and then have a butten on that leading to the form I have already done.
 
Thanks for responding but using the database Jet.4.0. I had several other major bugs,
I'd love to know what they were.. There are probably more than a billion instances of Jet databases in active use today.. Microsoft might need to know about the bugs you found..
 

Latest posts

Back
Top