Print Page | Close Window

MDI Tabs -- improve functionality

Printed From: Codejock Forums
Category: General
Forum Name: Visual Basic Code Snippets
Forum Description: Visual Basic Code Snippets
URL: http://forum.codejock.com/forum_posts.asp?TID=13185
Printed Date: 21 November 2024 at 5:56am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: MDI Tabs -- improve functionality
Posted By: chrisABC
Subject: MDI Tabs -- improve functionality
Date Posted: 15 January 2009 at 11:11am
Using MDI Tabs with Groups (ActiveX in VB6) I find it useful to sometimes set a childForm.Enabled = False.  This lets user view the form but they cannot edit it or give it focus. 

However, because of the way CommandBars works, you can get get into situation where the not-enabled Form is on top, and it is impossible to select any other Form.

Secondly, because CommandBars seems to store the current Tab for each Group, it can be difficult for user to switch to different Group (ie. clicking on the current Tab is ignored by CommandBars, even if it is in a different Group).


I found that adding the following code in the Workspace_BeforeItemClick event solves both of the above problems, and does not appear to have any side-effects.

   Dim X as Long
   For X = 1 to Forms.Count - 1    'ignore Forms(0) the MIDForm
      If Forms(X).hwnd = Item.Handle then
           Forms(X).ZOrder 0   
              'Force this Form (and hence this Tab) to be selected
      End If
   Next






-------------
Chris (Manchester, UK) -- www.abc6.co.uk ---- Using CodeJock ActiveX Suite 13.1.0 with Windows8, VB6 SP6



Replies:
Posted By: faakher
Date Posted: 28 November 2011 at 10:34am
nice tip LOL

-------------
Product: Xtreme SuitePro (ActiveX) version 15.0.1
Platform: Windows XP Professional - SP2
Language: Visual Basic 6.0 SP6



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net