Codejock Forums Homepage
Forum Home Forum Home > General > Code Snippets > Visual Basic Code Snippets
  New Posts New Posts RSS Feed - MDI Tabs -- improve functionality
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

MDI Tabs -- improve functionality

 Post Reply Post Reply
Author
Message
chrisABC View Drop Down
Senior Member
Senior Member
Avatar

Joined: 05 June 2008
Status: Offline
Points: 258
Post Options Post Options   Thanks (0) Thanks(0)   Quote chrisABC Quote  Post ReplyReply Direct Link To This Post Topic: MDI Tabs -- improve functionality
    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
Back to Top
faakher View Drop Down
Groupie
Groupie
Avatar

Joined: 26 June 2010
Location: Saudia Arabia
Status: Offline
Points: 24
Post Options Post Options   Thanks (0) Thanks(0)   Quote faakher Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.172 seconds.