Short version: I have a scrollable Panel (Panel1) containing numerous Userforms that scrolls back to the top after a UserForm at itís bottom is refreshed/updated. I want it to stay where it was - with the selected UserForm in view. Any/all help greatly appreciated. Thanks!
Details: Iím teaching myself VB.Net (Visual Studio 2010). Previous experience with VB6, so Iím familiar with a lot of the language, but not great with OOP and the .Net framework (yet). Anyway, Iím creating an employee scheduler Ė Panel1 contains an array(20,7) of UserForm1. UserForm1 contains various info about an employeeís shift, and also fires a ĎDouble_Clickedí event whenever it is double-clicked. For each UserForm, I used AddHandler to point each UserFormís Double_Clicked event to a single ĎBox_Double_Clickedí procedure, passing only the object that fired the event. Box_Double_Clicked parses the UserFormís unique number, and performs action(s) against the UserForm and/or the entire app, depending on which UserForm is double-clicked. So Ė for example, when the user scrolls to the bottom of the panel, double-clicks a UserForm in the bottom row(s), after the UserForm is updated, the panel scrolls back to the top, and I need it to stay wherever it was before the double-click. The only info Iíve found was setting/restoring Panel1.Scrollbar.AutoScrollPosition, but I couldnít get that to work.
Iím sure Iíve violated a ton of standards, and surely thereís a better way to go about this. But, itís trial & error learning, and itís still just a hobby, for now, and I love it. Hopefully I described what Iím doing well enough. Anyway, can anyone offer guidance? Thanks !
Page 1 of 1
3 Replies - 515 Views - Last Post: 21 January 2013 - 03:36 PM
Replies To: Scrollable Panel scrolls back to top
Re: Scrollable Panel scrolls back to top
Posted 20 January 2013 - 08:26 PM
Instead of a having a multi-dimension array you could use Entity Framework - not only is it a database model it make database look and feel like OOP - classes and properties. And isn't that what you want in scheduler - a database?
Page 1 of 1