15,907,183 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Member 8525993 (Top 40 by date)
Member 8525993
12-Dec-13 9:26am
View
Deleted
This does sound like the best solution. thanks
Member 8525993
12-Dec-13 9:25am
View
Is this for windows form application or wpf application ?
Member 8525993
11-Dec-13 17:30pm
View
Thanks. but i do not think there is a listboxitem() or something similar to that.
Member 8525993
11-Dec-13 16:58pm
View
Could you please tell me how exactly do you do that?
I know you can do that with listview but i am not sure how to do that with listbox.
Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
' ListBox()
ListView1.Columns.Add("MyHeader", ListView1.Width)
ListView1.View = View.Details
Dim lv As New ListViewItem
lv.Text = "Fourty Five"
lv.Tag = 45
ListView1.Items.Add(lv)
Dim lv2 As New ListViewItem
lv2.Text = "Fourty six"
lv2.Tag = 46
ListView1.Items.Add(lv2)
End Sub
Private Sub ListView1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListView1.SelectedIndexChanged
MessageBox.Show(ListView1.FocusedItem.Text & "=" & ListView1.FocusedItem.Tag.ToString)
End Sub
Member 8525993
11-Dec-13 16:23pm
View
Could you please give me a example ? if i add two item how would i determine tag after users selected that item.
or refer me to site that has good exams?
Member 8525993
13-Nov-13 10:45am
View
The problem i had with the above code is result was a byte instead of integer.
Thanks Sergey for the knowledge. if you think there a better way let me know. appreciate it ..
------- my working solution is below ------
Dim index1, index2 As Byte ' represent the first 2 elements
Dim result as integer
index2 = &H10
index1 = &HD
Dim index1_s, index2_s As Short
index1_s = index1
index2_s = index2
result = index1_s + (index2_s << 8)
Member 8525993
13-Nov-13 10:18am
View
HI
I am using vb.net. sorry for the confusion.
i call an api that return an array that has 8 element. The elements are type byte. The first two elements represent an index.
example. array(0) = &H10 and array(1) = &HD
so the index would be &100D
How exactly can I combine the two bytes to represent one number ?
I tried saving the
Array(0) as a short
Array(1) as a short
Result = array(0) + array(1)<<8
--------------------- below is the code i try --------------
Dim index1, index2, result As Byte ' represent the first 2 elements
index2 = &H10
index1 = &HD
Dim index1_s, index2_s As Short
index1_s = index1
index2_s = index2
result = index1_s + (index2_s << 8) 'i get a overflow error
Member 8525993
31-Oct-13 11:24am
View
lol oh got it ..
Member 8525993
30-Oct-13 17:09pm
View
huh? what is the better way of doing it ??
Member 8525993
30-Oct-13 16:08pm
View
ok. since it is better to use two loops i will stick to current way. Thanks.
Member 8525993
29-Oct-13 15:16pm
View
lol. Perfect!! Thanks you so much ...
Member 8525993
29-Oct-13 15:07pm
View
I did that and I got this error message " button is a type and cannot be used as an expression."
Member 8525993
29-Oct-13 14:45pm
View
How exactly will i write this for just the buttons? without having to list them all or declare all of them.
Member 8525993
29-Oct-13 11:27am
View
Below code works fine. if you have better ideas of doing it please share. thanks again for answering my question
Public Sub EnableControls(controls As Control.ControlCollection, enable As Boolean)
Dim clabel As Control = Label1
For Each c As Control In controls
If Not (c Is clabel) Then
EnableControls(c.Controls, enable)
c.Enabled = enable
End If
Next
End Sub
Member 8525993
29-Oct-13 10:59am
View
Thanks that is a interesting way of doing it. I did not think of that. very simple too. thanks
Member 8525993
29-Oct-13 10:58am
View
Thanks you so much for answering my question. This is exactly what i wanted. also how do i exclude certain control from being effect. For instance label1
Public Sub EnableControls(controls As Control.ControlCollection, enable As Boolean)
For Each c As Control In controls
If c <> label1 Then
c.Enabled = enable
EnableControls(c.Controls, enable)
End If
Next
End Sub
Member 8525993
29-Oct-13 9:25am
View
Deleted
Can you please provide me with an example (for Winform not WPF)?
Member 8525993
29-Oct-13 9:16am
View
Can you provide me a simple code please ? for winform not WPF..
Member 8525993
28-Oct-13 18:28pm
View
sorry about that. WinForm
Member 8525993
17-Oct-13 9:37am
View
Thank you so much. you totally answer my question!!!
but the problem i was having had to do with dropbox. when i delete or create a file dropbox would sync it. while dropbox was syncing it had permession/control over text file result in an error. Once i moved it out of my dropbox it worked fine ...
Member 8525993
17-Oct-13 9:35am
View
Deleted
Thank you so much. you totally answer my question!!!
but the problem i was having had to do with dropbox. when i delete or create a file dropbox would sync it. while dropbox was syncing it had permession/control over text file result in an error.
Member 8525993
17-Jul-12 10:33am
View
thanks you . i will look into this.
Member 8525993
17-Jul-12 9:00am
View
if i got 32 bit data that is little endian format
{a,b,c,d}
to find decimal value for it i would do
Rx_POS_CANopenData = d And &H7F
Rx_POS_CANopenData = Rx_POS_CANopenData * &H100
Rx_POS_CANopenData = Rx_POS_CANopenData +c
Rx_POS_CANopenData = Rx_POS_CANopenData * &H100
Rx_POS_CANopenData = Rx_POS_CANopenData + b
Rx_POS_CANopenData = Rx_POS_CANopenData * &H100
Rx_POS_CANopenData = Rx_POS_CANopenData + a
the decimal value that i would get for Rx_POS_CANopenData will be 1000. what happen if the decimal value is negative ?
Member 8525993
14-May-12 9:36am
View
SA
Thanks, I went with the second option.
Member 8525993
24-Apr-12 13:45pm
View
Thanks a lot!!! works fine now..
Member 8525993
24-Apr-12 11:02am
View
Deleted
'this is the predefine lib hex value
Enum predefineERR
err1 = &H6090011 '06 09 00 11
err2 = &H504005
err3 = &H8000023
End Enum
Dim currentERR As predefineERR
Private Sub Button9_Click(sender As System.Object, e As System.EventArgs) Handles Button9.Click
Dim mychar As String
Dim errorDef(4) As Byte
'let say i got
errorDef(0) = 17
errorDef(1) = 0
errorDef(2) = 9
errorDef(3) = 6
mychar = "&H" + Hex(errorDef(3)) + Hex(errorDef(2)) + Hex(errorDef(1)) + Hex(errorDef(0))
Dim xx As Integer = mychar
currentERR = mychar
If currentERR = predefineERR.err1 Or currentERR = predefineERR.err1 Or currentERR = predefineERR.err2 Then
If currentERR = xx Then
MsgBox("they are equal")
End If
End If
End Sub
Member 8525993
24-Apr-12 10:55am
View
i am using it. i think my logic may be wrong because i am convert values that are return from the api to string then converting them to hex.
Member 8525993
16-Feb-12 14:10pm
View
yes..... that was the question. thanks.
Member 8525993
16-Feb-12 13:30pm
View
take the reciprocal of what value ?
Member 8525993
16-Feb-12 10:58am
View
Since we know it will take 250,000 bits/s
we can use 250,000bits/sec = xbits/1sec
so in one second we can transfer 250,000 bits.
-------------------
and one byte = 8btye
so 250000 bits * (1bytes/8bits) = 31250 btyes
Member 8525993
16-Feb-12 9:56am
View
Jochen,
thanks for the fast response. can you elaborate a little more? and what are the rule of three?
Member 8525993
16-Feb-12 9:54am
View
Deleted
Michael,
using your formula it would take 32,000 sec to transfer 1 bytes. and 16,000 sec to transfer 2 bytes.
that seem like a long time. are my calculation correct?
Member 8525993
14-Feb-12 15:57pm
View
SAKryukov
thanks a lot for the explanation.
sorry for the late reply. been out the country.
Member 8525993
8-Feb-12 18:10pm
View
some comments online says at the best timer is like 20ms other says 100ms. so i figure my logic may be off ..
Member 8525993
8-Feb-12 18:05pm
View
ok.
Not sure. Did you got a chance to look at my code? do you think the logic could be part of the reason for the bad timing ?
Member 8525993
8-Feb-12 17:46pm
View
oh ok. mmmm. i am pretty lost here. so any help or suggestions are greatly appreciated.
Do you think my logic is wrong ? i am getting big different in overall time
Member 8525993
8-Feb-12 17:22pm
View
It will be great to get it as accurate as possible.
I wanted it down to like 10 ms but from your past comments I doubt that is possible. Since you know more about the subject matter, can you tell what accuracy I should be aiming to meet?
My current code
Like if I put 20 # of message to sent & 50 ms to do work. Sometime it off by 180 ms. And sometime if I am playing with the form window it off by more.
Member 8525993
8-Feb-12 16:40pm
View
thanks for the help.
well i want to send x amount of messages, NumOfMessagesToSent, in a certain time[NumOfMessagesToSent*timePERmessage]. Then keep repeating it until I stop the program.
Every time a message is sent I want to calculate elapsed time. IF that elapsed time is less than time allow to send one message, timePERmessage, I want to report failure.
Similar if the total time for all the messages is less than total time allow[NumOfMessagesToSent*timePERmessage] i want to report failure
*NumOfMessagesToSent determine by user
*timePERmessage determine by user
Member 8525993
8-Feb-12 15:59pm
View
OK. sorry, i posted it so you could see what i was doing ..
can you tell me how accurate timer is? is there something better than what i am using?
Member 8525993
8-Feb-12 15:54pm
View
well it more than couple ms. i have posted solution below if that help ..
Show More