• Windows docking: Visual Basic

    Home » Forums » Developers, developers, developers » DevOps Lounge » Windows docking: Visual Basic

    Author
    Topic
    #491440

    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!

    Thanks
    Ted

    Viewing 1 reply thread
    Author
    Replies
    • #1416804

      Ted,

      See this MS Article on the SDI vs MDI interface. If you scroll down to the section on VBA you might find what you are looking for. HTH :cheers:

      May the Forces of good computing be with you!

      RG

      PowerShell & VBA Rule!
      Computer Specs

    • #1424195

      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

      With Overview
      .TopLevel = False
      .FormBorderStyle = Windows.Forms.FormBorderStyle.None
      .Visible = True
      .Dock = DockStyle.Fill
      End With

      Me.Controls.Add(Overview)

      End Sub

    Viewing 1 reply thread
    Reply To: Windows docking: Visual Basic

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: