I want to make my program extra fancy and sync up two listboxes with this code:
VB Code:
Private Sub lstQNum_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lst1.SelectedIndexChanged lst2.SelectedIndex = lst1.SelectedIndex End Sub
and the opposite for the other one. But of course there's about a half second delay before the correct item gets highlighted in the opposite listbox and it's VERY noticeable. I tried using suspendlayout and resumelayout which did nothingi tried manual refreshes in various places and they didn't help
I tried it with threading and you can't access a control from a thread it wasn't created in or you have a Microsoft moment (even if it's declared as public!)
I tried doing the suspend and resume layout technique using selectedvaluechanged and selectedindexchanged since value fires first and that didn't help. I can't think of anything else to try so is there another way that you guys have gotten it to work in the past?




i tried manual refreshes in various places and they didn't help
Reply With Quote