3 Replies - 274 Views - Last Post: 21 January 2013 - 03:36 PM Rate Topic: -----

#1 JDGiants  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 18-October 11

Scrollable Panel scrolls back to top

Posted 20 January 2013 - 07:35 PM

Hi, all.
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 !

-J.D.

Is This A Good Question/Topic? 0
  • +

Replies To: Scrollable Panel scrolls back to top

#2 _HAWK_  Icon User is offline

  • Master(Of Foo)
  • member icon

Reputation: 1030
  • View blog
  • Posts: 4,010
  • Joined: 02-July 08

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?
Was This Post Helpful? 0
  • +
  • -

#3 JDGiants  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 18-October 11

Re: Scrollable Panel scrolls back to top

Posted 21 January 2013 - 03:27 AM

Thanks for the reply. No idea about Entity Framework - I'll look into it after work today. Any other suggestions, anyone?
Was This Post Helpful? 0
  • +
  • -

#4 JDGiants  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 18-October 11

Re: Scrollable Panel scrolls back to top

Posted 21 January 2013 - 03:36 PM

Solved - in case it helps anyone out there:

Userform.Select

Like I said, newbie....
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1