Hi again,
I have another question about function implementation on my recent fun/side project. I found an article on scrolling listboxes in sync here
Synchronized ListBox objects (or how to scroll 2 ListBox objects together)[
^]
What I can't discern is how to trigger events. I posted the top portion of code into a cs file (namespace i think), added 2 of the custom listboxes etc. That all went well.
I then proceeded to add the following functions to my form called Output.cs, which is an output form that contains the following modified listBox functions:
private void lstOutputNumbers_OnVerticalScroll(object sender, ScrollEventArgs e)
{
MessageBox.Show("");
lstOutput.TopIndex = lstOutputNumbers.TopIndex;
}
private void lstOutput_OnVerticalScroll(object sender, ScrollEventArgs e)
{
MessageBox.Show("");
lstOutputNumbers.TopIndex = lstOutput.TopIndex;
}
Here is the original Code:
private void syncListView2_OnVerticalScroll(object sender, ScrollEventArgs e)
{
syncListView1.TopIndex = syncListView2.TopIndex;
}
private void syncListView1_OnVerticalScroll(object sender, ScrollEventArgs e)
{
syncListView2.TopIndex = syncListView1.TopIndex;
}
The only modifications I made were to the lstBox names; lstOutPutNumbers, and lstOutput, as well as added messageboxes for testing. However, no matter how I scroll I am not able to get a synchronized scroll, or even messageboxes to appear which tells me the event is not being triggered by scrolling. Anyone able to help me puzzle through this?
Appreciate the previous help from this community. Hopefully you guys can help me tackle this one also.
~Travis