Arrays And List Boxes - VB6 Codes needed

free web hosting
Free Web Hosting, No Ads > CONTRIBUTE > Computers > Programming Languages > VB Programming

Arrays And List Boxes - VB6 Codes needed

tobimichigan
Hello Guys,

I am working on an application. It is such that there are 2 list boxes or combo boxes. One is Labeled Departure and the other is labeled Destination. The boxes contain various states in America and each state has its unique feature of distances. The difference of the distances has to be reflected on a label.
Where I need help is a code to execute the contents of the array into values For instance:

Option Explicit

Private Type Stateinfo
statedeparture as integer
stateDestination as integer
TotalDistance as integer
End Type
Dim StateDistance (10, 20) as stateinfo

How do I code the list-boxes to display the Form_Load values in a label?
Hope to hear from you soon.
TM

Reply

Galahad
Ok, you're going to have to be much clearer than this...

If I understand you correctly, you want a certain label to show distance between two destinations? The easiest way would be to have the distances encoded in a matrix, and just pull the stiff from it... For example, distance between state 1 and state 8 is 100.... So, array Distances(1,8) = 100.... And so on... Get the idea?

I just assumed this is what you want, if not, explain a little further and maybe I'll be able to help...

Reply

minimcmonkey
I havent done a lot of VB recently, but i use to use it a lot.
I would recoment for a smaller list, just have a list of distances between each desination, and departure.
you should probably plan that out first, by making a table like

# 1 2 3
_____
1|0 2 7
2|2 0 9
3|7 9 0




- some of the maths might not work in that above - i wasnt really thinking.

If there are lots of locations, you might have to use a graphical or grid appoach - i have never really used that before, so im not sure how you would do it. But just a list of distances would be the easiest method by far!

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:

Similar Topics

Keywords : arrays boxes vb6 codes needed

  1. Visual Basic 6.0 Help Needed - Adding lines to a textbox without delete (15)
    I need help with Visual Basic 6.0 and adding lines to a textbox without deleting any previous
    lines.. I've gotten as far as finding a way to add the lines, but it deletes the prevous entree.
    Help is appreciated!...
  2. Ftp In Vb 2005 - badly needed! (0)
  3. Help Needed - (7)
    Hello guys...I made a program but when i run it i get a debug because i put the wrong timers action
    i tried to change it but still: Private Sub Form_Load() Let lblTime.Caption = Let Timer1.Enabled =
    True Let Timer2.Enabled = False End Sub Can anybody tell me how to put the timers auction on the
    second line?...



Looking for arrays, list, boxes, vb6, codes, needed

Searching Video's for arrays, list, boxes, vb6, codes, needed
advertisement



Arrays And List Boxes - VB6 Codes needed



 

 

 

 

ADD REPLY / Got an Opinion! a humble request :-) RAPID SEARCH! Free Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE