Hi, all.
Short version: I have a scrollable Panel (Panel1) containing numerous Userforms that scrolls back to the top after a UserForm at its 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: Im teaching myself VB.Net (Visual Studio 2010). Previous experience with VB6, so Im familiar with a lot of the language, but not great with OOP and the .Net framework (yet). Anyway, Im creating an employee scheduler Panel1 contains an array(20,7) of UserForm1. UserForm1 contains various info about an employees shift, and also fires a Double_Clicked event whenever it is double-clicked. For each UserForm, I used AddHandler to point each UserForms Double_Clicked event to a single Box_Double_Clicked procedure, passing only the object that fired the event. Box_Double_Clicked parses the UserForms 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 Ive found was setting/restoring Panel1.Scrollbar.AutoScrollPosition, but I couldnt get that to work.
Im sure Ive violated a ton of standards, and surely theres a better way to go about this. But, its trial & error learning, and its still just a hobby, for now, and I love it. Hopefully I described what Im doing well enough. Anyway, can anyone offer guidance? Thanks !
-J.D.
Short version: I have a scrollable Panel (Panel1) containing numerous Userforms that scrolls back to the top after a UserForm at its 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: Im teaching myself VB.Net (Visual Studio 2010). Previous experience with VB6, so Im familiar with a lot of the language, but not great with OOP and the .Net framework (yet). Anyway, Im creating an employee scheduler Panel1 contains an array(20,7) of UserForm1. UserForm1 contains various info about an employees shift, and also fires a Double_Clicked event whenever it is double-clicked. For each UserForm, I used AddHandler to point each UserForms Double_Clicked event to a single Box_Double_Clicked procedure, passing only the object that fired the event. Box_Double_Clicked parses the UserForms 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 Ive found was setting/restoring Panel1.Scrollbar.AutoScrollPosition, but I couldnt get that to work.
Im sure Ive violated a ton of standards, and surely theres a better way to go about this. But, its trial & error learning, and its still just a hobby, for now, and I love it. Hopefully I described what Im doing well enough. Anyway, can anyone offer guidance? Thanks !
-J.D.