Thread: Windows docking: Visual Basic
2013-10-14, 21:29 #1
- Join Date
- Feb 2011
- Redford MI 48240
- Thanked 0 Times in 0 Posts
Windows docking: Visual Basic
I'm having a geeky moment here. I would like to know if there is a way to code the Dock Right and Dock Left functions in Windows 7 & 8.
Every night at work I open two Excel Spreadsheets. I'm using Excel 2013 with the single doc interface.
I open the first workbook press Windows + Left Arrow to dock it to the left side, then I dock the second workbook to the left.
I would love to find a way to work this down to a single action. I have Visual Studio 2021 and of course access to VBA. The first workbook is company data that is passed around so it cannot have any code attached to it. The second is for my personal use. I've already added a few macros to it to help with some of the timekeeping functions on the first. I'm using my personal machine to do the work so I have room to play there.
I've been out of practice with VB so my familiarity with the interface is a bit dated.
Really a few hints on how I can discover for myself would be the best!
Subscribe to our Windows Secrets Newsletter - It's Free!
Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 7, Windows 8, Windows XP, Firefox, Internet Explorer, Google, etc. Join our 480,000 subscribers!
+ Get this BONUS — free!
Get the most of Excel! Learn about new features, basics of creating a new spreadsheet and using the infamous Ribbon in the first chapter of Excel 2013: The Missing Manual - Subscribe and download Chapter 1 for free!
2013-10-14, 22:39 #2
- Join Date
- Mar 2004
- Manning, South Carolina
- Thanked 726 Times in 662 Posts
2013-11-21, 07:02 #3
- Join Date
- Mar 2010
- Winston-Salem, NC USA
- Thanked 3 Times in 3 Posts
In Visual Studio, a form itself does not have "exposed" docking properties... but you can make a form look like a control and have a parent form contain the controls. The good news is, controls are dockable.
Here's a sample that I'm using in a project using one form as a control and I'm docking it in the parent form. You can create multiple forms and set the docking properties as you like. You may want to use a combination of docking and anchoring to achieve the thing you're talking about.
Private Sub InitOverview()
Dim Overview As New frmDock
.TopLevel = False
.FormBorderStyle = Windows.Forms.FormBorderStyle.None
.Visible = True
.Dock = DockStyle.Fill
Last edited by Bender; 2013-11-21 at 07:06. Reason: small correctionDo your part!!! Report SPAM to http://www.spamcop.net/