944,175 Members | Top Members by Rank

Ad:
May 26th, 2007
0

About Progress Bar

Expand Post »
Hi To all,i used progress bar control of 7 array i.e 0 to 7 ProgressBar(PB) with same name pb1 ,but how to write code for each .My code is working if i select 1 PB and there is any other event for pb that i should not click on pb it directly retrieve data from port ,thus we can load pb in a Form load which on loading it directly retrieve data.
Pls hlp in this. And i want to use array for storing data and recieving data that if i storing data from array 0 to 15 .so, if i store some command on 0th element of array that will trigger to the port and if any reply from port then it will store on the 0th element of the array and keep some timeout between this elements to retrieve and send .And can we keep this structure in a loop that we have not to press any key for it to start that it will start during form load.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Unverified User
jatinder_44 is offline Offline
28 posts
since Apr 2007
May 28th, 2007
0

Re: About Progress Bar

Hi To all,i used progress bar control of 7 array i.e 0 to 7 ProgressBar(PB) with same name pb1 ,but how to write code for each .My code is working if i select 1 PB and there is any other event for pb that i should not click on pb it directly retrieve data from port ,thus we can load pb in a Form load which on loading it directly retrieve data.
To change the value of each progress bar you would type:
pb1(x).value = value
Replace x with the number of the progress bar and value with the value you want it. So if you wanted to make the 3rd progress bar's value 50 you would type
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. pb1(3).value = 50
You can change other attributes of the progress bar the same way (like width, height etc.) for the width would do:
pb1(x).width = value
To make the value of each progress bar the same you would put it in a loop like this (replace value with either a number or another variable):
For x = 0 to 7
pb1(x).value = value
Next x
To retrieve a value you would use:
something = pb1(x).value
Hope that answers your question about the progress bars
Reputation Points: 10
Solved Threads: 1
Newbie Poster
Aaraggornn is offline Offline
7 posts
since May 2007
May 29th, 2007
0

Re: About Progress Bar

thanx Aaraggornn,it works my new question to u how to type cast integer value in float i wnt to calc this formula
int Recieved data
float batt voltage
batt vol.. =(float)Recieved data *0.0390625

i want batt vol .. value in float does vb support float type
Reputation Points: 10
Solved Threads: 0
Unverified User
jatinder_44 is offline Offline
28 posts
since Apr 2007
May 29th, 2007
0

Re: About Progress Bar

Double is the equivalent for float

Here is the way to do that
Sub Convert2_Dbl()
Dim Recieved_data As Integer
Dim batt_voltage As Double
Recieved_data = 2
batt_voltage = CDbl(Recieved_data * 0.0390625)
End Sub
Reputation Points: 10
Solved Threads: 1
Newbie Poster
shasur is offline Offline
20 posts
since Aug 2006
May 29th, 2007
0

Re: About Progress Bar

Thank u shasur this is code which iam using to send data and recieved dzta from port .what data coming from port is in AAA,EEE,LLL like this i want to use this value with the above formula it is not converting to integer ,string ,decimal
Dim ByteToSend(0 To 6) As Byte
Dim Buffer As Variant
Dim datain As Variant 'this is my recieved data
Dim dummy As String
Dim Battery As Double
Dim intdata As Variant
ByteToSend(0) = &H64 'Text5.Text
ByteToSend(1) = &H64 'Text5.Text
ByteToSend(2) = &H64 'Text5.Text
'ByteToSend(3) = &H64
'ByteToSend(4) = &H64
'ByteToSend(5) = &H61
Buffer = ByteToSend()
MSComm1.Output = Buffer
Do
dummy = DoEvents
Loop Until MSComm1.InBufferCount > 2
datain = MSComm1.Input
intdata = datain 'it giving 0 intdata
Debug.Print intdata
Battery = CDbl(intdata * 0.0390625)
ProgressBar4.Value = Val(Asc(Mid$(Battery, 1, 2)))'here it not display in the progess bar not even it text.
Text10.Text = Val(Asc(Mid$(Battery, 1, 2)))

thanxz for reply i will wait for u r rply thanx.
Reputation Points: 10
Solved Threads: 0
Unverified User
jatinder_44 is offline Offline
28 posts
since Apr 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Visual Basic 4 / 5 / 6 Forum Timeline: Automate Microsoft Word From VB6
Next Thread in Visual Basic 4 / 5 / 6 Forum Timeline: Can anyone help?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC