I’m creating an accounting-like software and doing the General Ledger. Now my plan is to have a UserControl called Entry, which shows and have Properties called: Date, Details, Amount. I have two FlowLayoutControls, one for Debit, one for Credit.
What I want to achieve:
As I slide the Debit side down, I want the credit to automatically slide down to an entry with a same or nearby date. Or to the same month, when the Ledger is balanced.
My idea:
Determine the highest visible UserControl, get its Date value. Then on the other side, go through every UserControl and its Date value and scroll it to the one that fits the above description best.
Can anybody please help me with the coding and the properties of the FlowLayoutPanels in order to achieve this?
Thank you.
Implement the FLP’s Scroll event. Iterate its controls and find out which one is located at the top:
Cast the ctl to your user control type and retrieve the property you want. Then iterate the other FLP to find the matching control, set the FLP’s AutoScrollPosition to scroll it into view.