By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,899 Members | 1,230 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,899 IT Pros & Developers. It's quick & easy.

Picture Array in a simple array

P: 17
I have simple array on this form but want to tie in another array for pictures.. Combobox select the Phone and this set the array to fit the other text boxes name,address,brithday. Now I want add a picture into the mix.
Expand|Select|Wrap|Line Numbers
  1. Option Explicit On
  2. Option Strict On
  3. Imports Microsoft.VisualBasic.ControlChars
  4. Imports System.Convert
  5.  
  6. Public Class frmMain
  7.     Dim Phone() As String = {"(864) 463-1040", "(864) 463-1039", "(864) 463-1038", "(864) 463-1037", "(864) 463-1036", "(864) 463-1035", "(864) 463-1034", "(864) 463-1033", "(864) 463-1032", "(864) 463-1031", "(864) 463-1030"}
  8.     Dim FName() As String = {"John Smith", "Wild Bill", "Smokin Joe", "Fred Sampson", "Hank Will", "Eddie Weathers", "Smart Guy", "Bob Willis", "Led Light", "Happy Dazes"}
  9.     Dim Address() As String = {"1010 Wood Street", "124 Wild Road", "Beef Jerky Lane", "Big Guy Road", "Drink Street", "BreakWind Road", "Twoby Four Road", "Ditch Road", "Bright Lane", "Lost Road"}
  10.     Dim BirthDay() As String = {"7/4/2001", "5/5/1969", "9/12/1970", "9/02/2002", "4/4/1960", "5/25/1962", "1/10/1962", "1/06/1996", "2/22/2002", "12/12/1969"}
  11.     Dim imgPictures() As Image
  12.  
  13.  
  14.     Private Sub cboPhone_SelectedIndexChanged(sender As System.Object, e As System.EventArgs) Handles cboPhone.SelectedIndexChanged
  15.         Dim Num As Integer
  16.         Num = cboPhone.SelectedIndex
  17.         txtName.Text = FName(Num)
  18.         txtAddress.Text = Address(Num)
  19.         txtBirth.Text = BirthDay(Num)
  20.  
  21.  
  22.     End Sub
  23.  
  24.     Private Sub btnExit_Click(sender As System.Object, e As System.EventArgs) Handles btnExit.Click
  25.         Me.Close()
  26.     End Sub
  27.  
  28.     Private Sub btnClear_Click(sender As System.Object, e As System.EventArgs) Handles btnClear.Click
  29.         cboPhone.Text = ""
  30.         txtName.Text = ""
  31.         txtAddress.Text = ""
  32.         txtBirth.Text = ""
  33.  
  34.     End Sub
  35. End Class
  36.  
  37.  
Any Ideas ??
Mar 6 '12 #1
Share this Question
Share on Google+
1 Reply


P: 17
Ok to add another array with Pictures

Expand|Select|Wrap|Line Numbers
  1. Private Sub cboPhone_SelectedIndexChanged(sender As System.Object, e As System.EventArgs) Handles cboPhone.SelectedIndexChanged 
  2.         Dim Num As Integer 
  3.         Num = cboPhone.SelectedIndex 
  4.         txtName.Text = FName(Num) 
  5.         txtAddress.Text = Address(Num) 
  6.         txtBirth.Text = BirthDay(Num) 
  7.  
  8. PictureBox1.Image = ImageList1.Images(Num)
  9.  
You dont have add another array code , Just use ImageList (Toolbox)
add pictures in the order you need them ...
Simple, fun and useful project...
Mar 7 '12 #2

Post your reply

Sign in to post your reply or Sign up for a free account.