|
Sorry, I didn't pay attention enough to the bindings. I haven't done this myself with bindings, I trust the idea remains the same (avoid the loop of events), the execution will have to be slightly different. I hope somebody will be able to give you more precise instructions, IMO it boils down to "don't set a binding again that has already been set".
|
|
|
|
|
Hi,
Once again thanks..I think I solve this issue..what I notice now is that on the MarkComboBox, it shows multiple marks of the same kind whereas I only want to show one mark..
thanks again
|
|
|
|
|
Hello,
I am not able to convert this function to VB code....
This is the javascript function to get the last digit of a GTIN number:
factor = 3;
sum = 0;
var gNum = '1234564020233'
for (index = gNum; index > 0; --index) {
sum = sum + gNum.substring(index - 1, index) * factor;
factor = 4 - factor;
}
cc = ((1000 - sum) % 10);
result = gNum + cc;
}
I have the problem to deal with the substring function.
Anyone can help?
|
|
|
|
|
OK, JavaScript substring returns the string enclosed by the start and ending values. In your case that would be index - 1 , and index . It appears that index starts out with the length of the string in gNum and goes backwards by -1 with each iteration.
|
|
|
|
|
factor = 3
sum = 0
Dim gNum As String = "1234564020233"
For index = gNum To 1 Step -1
sum = sum + gNum.Substring(index - 1, index - (index - 1)) * factor
factor = 4 - factor
Next index
cc = ((1000 - sum) Mod 10)
result = gNum + cc
David Anton
Convert between VB, C#, C++, & Java
www.tangiblesoftwaresolutions.com
|
|
|
|
|
Hi David,
I got this error:
System.Data.Index' is not accessible in this context because it is 'Private'.
|
|
|
|
|
It must be due to 'index' not being declared.
Try:
For index As Integer = gNum To 1 Step -1
David Anton
Convert between VB, C#, C++, & Java
www.tangiblesoftwaresolutions.com
|
|
|
|
|
any advice on how to scroll both text box at the same time ?
|
|
|
|
|
kun85 wrote: any advice on how to scroll both text box at the same time ?
Replace them with a DataGridView and scroll that. Two text-columns should do the trick
I are Troll
|
|
|
|
|
That only works well when the two texts have the same number of lines, and the lines of both texts are supposed to match up. The OP wasn't clear on this at all, it could equally well be about a table of content and the content itself (like the "Document Map" Word offers).
|
|
|
|
|
Luc Pattyn wrote: That only works well when the two texts have the same number of lines, and the lines of both texts are supposed to match up.
Needn't be the same lines, but there would have to be a relation between them. That's what I expect when someone wants to scroll the contents of two different containers simultaneous. It'd work best if both have an equal amount of lines, but the same applies to a textbox.
In that sense, a property-grid looks like two scrollable textboxes to me. One line, one record
I are Troll
|
|
|
|
|
Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged
ListBox2.SetSelected(ListBox1.SelectedIndex, True)
End Sub
If there is a chance that the two lists could have differing item counts then use the Try Catch block to avoid selecting an invalid index.
Good luck!
It was broke, so I fixed it.
|
|
|
|
|
Unfortunately a WinForms ListBox does not offer scroll events, so the only technique I'm aware of is by overriding its WndProc. Here[^] is an example (it is using C#, you can do the same in VB.NET).
Once you got scroll events, you can have the second ListBox mimic the scrolling of the first. You can also do it both ways, but then you probably need to be careful and avoid eternal loops.
|
|
|
|
|
Hello,everyone! I've knowan how to click treenode to make tabpages selected and show, but I don't want users could click the tabpage and selected one of them. I searched in internet and found that it should use a intenger such as "tab = 1" in some Tabcontrol and Tabpage events like this webpage said whick use TabPage1_Validating & TabPage1_Enter like below :
Private Sub TabPage1_Validating(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles TabPage1.Validating
If tab = 1 Then
e.Cancel = True
Else
e.Cancel = False
End If
End Sub
Private Sub TabPage1_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TabPage1.Enter
tab = 1 ' setting the selected tab when user gets back to this tab
End Sub
I tried it and now the tabpage could not click,but when I clicked treenode, it could not selected tabpage too.In fact,I didn't understand how the code in the webpage made tabpage disable click after I looked up in MSDN...
Could anyone give me some suggestions and help? Thanks a lot!
|
|
|
|
|
Why not just scrap the TabControl and use a stack of Panels instead?
|
|
|
|
|
Is there a Gecko Layout Engine .net Module? I want to have my web browser use the gecko layout engine, but I don't know how I can make that happen other than if there were a .net module for it. Thanks.
|
|
|
|
|
there is a tool called "google"
enter the terms:
gecko .net
press the "search" button and .... something wonderful will happen
|
|
|
|
|
I have done that and yet I haven't found anything on it, so I was hoping to get a reply from someone that has used something like it, so I can use that too... Your reply was rude, and I don't appreciate it.
|
|
|
|
|
maybe you did it ... but you didn´t read the page ....
a few lines below the "main" article you would have found a reference to geckofx .... and that is what you (probably) need.
to moan about a correct, short info as "rude", will prevent a lot of people to answer you in the future.
|
|
|
|
|
thebiostyle wrote: I have done that and yet I haven't found anything on it,
Here[^] it is
There doesn't seem to be a .NET specific library.
I are Troll
|
|
|
|
|
Hi, I was wondering if anyone knew if there was a way to output bytes through a comm port in a HEX format rather than ASCII using the SerialPort control or any other method.
Thanks,
|
|
|
|
|
A serial port can transmit arbitrary byte values (i.e. binary data) as well as textual data.
The former is supported by methods such as SerialPort.Read() and Write(), the latter by ReadChar(), ReadLine() and more.
Not sure what you mean by "HEX format". Is it just binary data? use Read/Write! Is it text according to some specific format (such as Intel Hex, Motorola S-records, whatever), build your string and send it, or receive your string and decode it.
|
|
|
|
|
I have an application "app1" which create a UDP socket with port no. 6677.This app broadcast a data packet.
I hav another application "app2" which also create UDP socke which always listen 6677.Whenever the data packet comes it do certain operations.
Now problem is , when I run these to apps on different machines in the network, app2 detects the data packet.But when I run both the applications on the same machine,app2 never detects the data packet.
What may e the problem???
UDP socket related code in app2 is pasted here....
wsClientRecieve.RemotePort = 6677
wsClientRecieve.RemoteHost = "127.0.0.1"
wsClientRecieve.LocalPort = 6677
wsClientRecieve.Bind 6677
Thanks in adv..
|
|
|
|
|
I don't know the answer to your problem, however, I always start by asking myself: would I be the only one with such a problem? when not, I try google[^]. There sure are some interesting hits, such as this one[^]. Good hunting!
|
|
|
|
|
jainiraj wrote: two UDP socket on the same machine..
Damn, i thought this was the start of a Joke and was waiting for the punchline.
|
|
|
|