Welcome!


Join more than 151,000 members on FunAdvice to ask questions, share advice, photos and make new friends today.
FunAdvice RSS for this page:
Rss_feed

Code snippets in vb.net

Asked by qqq 2 months ago, 2 answers.

I have to do the distance calculation project.so I located the two images in design page.there arise the problem!!
How to calculate the distance between the two images in the design page.there is no need to bother about the height ,width etc...
Pls...

help me

My Picture Answered by a7med93 on Sep 15, 2009, 03:54AM
73 answers

am not sure I understood the question but can't you just calculate it using the property location ?

12th man Answered by mrevil_e on Sep 17, 2009, 02:09AM
8 answers

Here try this:
___
Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click
Me.Close()
End Sub
Private Sub btnCalculation_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalc.Click
Dim intSpeed As Integer
Dim intTime As Integer
Dim intDistance As Integer
Dim intTotalDist As Integer
Dim intCount As Integer
Dim strDistance As String
Dim strTotalDist As String
Dim strMessage As String
Dim strSpeedInput As String
Dim strSpeedOutput As String
Dim strTimeInput As String
Dim strTimeOutput As String
Dim strList As String
Dim strError As String

'Clear the list box
lstDisplay.Items.Clear()

'Prompt for the speed of the vehicle
strMessage = Please enter the speed of the vehicle in miles-per-hour
strSpeedInput = InputBox(strMessage, Speed Input)
intSpeed = Val(strSpeedInput)

'Check for valid speed
If intSpeed = 1 Then

'Prompt for the time
strMessage = Please enter the time to travel in hour
strTimeInput = InputBox(strMessage, Time Input)
intTime = Val(strTimeInput)

'Check for valid time
If intTime = 1 Then

'Display speed output
strSpeedOutput = Vehicle speed: intSpeed MPH
lstDisplay.Items.Add(strSpeedOutput)

'Display time output
strTimeOutput = Time traveled: intTime hours
lstDisplay.Items.Add(strTimeOutput)

'Display hour and distance labels
strDistance = Hour Distance Traveled
lstDisplay.Items.Add(strDistance)

'Calculate Distance
intCount = 1
Do Until intCount intTime
intDistance = intSpeed * intCount

'Display the value of time and distance in the list box
strList = intCount intDistance
lstDisplay.Items.Add(strList)
intCount += 1
Loop

'Display the total distance
intTotalDist = intSpeed * intTime

strTotalDist = Total Distance: intTotalDist mile(s)
lstDisplay.Items.Add(strTotalDist)

Else 'Invalid time
strError = The time needs to be greater or equal to 1 hour
MessageBox.Show(strError, Invalid Time Data, MessageBoxButtons.OK, MessageBoxIcon.Error)

End If

Else 'Invalid speed
strError = The speed needs to be greater or equal to 1 mph
MessageBox.Show(strError, Invalid Speed Data, MessageBoxButtons.OK, MessageBoxIcon.Error)
End If
End Sub
___
That is all I got for the program in VB.

Answer this Question: "Code snippets in vb.net"

Your Answer: HTML is not allowed.


Our members said the answers on this page also answer the following questions:


Distance calculating vb.net code snippets, Chekc valid time using vb.net, Vb 2008 snippets, Vb listbox calculate distance, Vb listbox display calculate distance, Vb.net check 2 pictures equal, Vb distance per hour loop, Vb.net snippets, Snippet vb.net, Measure distance image vb.net, Vb.net from to distances and time, Distance from speed and time visual basic code, Strspeedoutput = "vehicle speed: " intspeed "mph" lst display.items., Adding string to listbox then calculate in vb, Distance traveled visual basic code, How to make vb.net snippets

Computers & Tech Photos

Bob cut - Victoria Beckham[:a snippet of me ;)

Share this question

Copy and paste this code:
It will display on your blog or site like this:
Code snippets in vb.net