Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Command Bars
  New Posts New Posts RSS Feed - (WORKAROUND) MDI Tab Groups events
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

(WORKAROUND) MDI Tab Groups events

 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: (WORKAROUND) MDI Tab Groups events
    Posted: 09 January 2009 at 6:37am
Using MDI Tabs the Workspace event   _SelectedChanged is fired each time a different Tab is clicked by user. That is good.

But when I have several Groups of Tabs, the   _SelectedChanged event does NOT always fire when user clicks different Tab if the Tab is in a different Group. It only behaves correctly if we stay in the same Group.

To explain better:  It seems each Group retains its own "Current Tab". When user clicks on any "current Tab" the Changed event does not fire -- even if Tab is in a different Group.

I expect this is Working As Designed (ie. not a bug).  But how can I detect when user clicks in a different Group ??  eg. is there a Group_Changed event?
 
WORKAROUND -- the Workspace_BeforeItemClick event is correctly fired for ALL times when user clicks on a Tab. Even if it is current Tab or in a different Group. So with a bit of logic I can use this event to get around the problem with  _SelectedChanged event.

But please still comment if I have missed something or there is a better way.
Chris (Manchester, UK) -- www.abc6.co.uk ---- Using CodeJock ActiveX Suite 13.1.0 with Windows8, VB6 SP6
Back to Top
PPL1 View Drop Down
Groupie
Groupie


Joined: 10 April 2006
Location: Canada
Status: Offline
Points: 70
Post Options Post Options   Thanks (0) Thanks(0)   Quote PPL1 Quote  Post ReplyReply Direct Link To This Post Posted: 04 December 2009 at 9:39pm
Bump... Can CJ confirm if this is a bug or not.

What's the purpose of a Workspace_SelectedChanged event if it does not fire when a different tab is selected ?

(current version still has this "behaviour")

BTW, the proposed workaround only works when the user actually "clicks" on the tab. For all other methods of selecting a different tab, this does not work (e.g. click on the contained form, keyboard, etc)

[edit] For those interested, until this is fixed, the way to go is using a timer and checking the Selected property. It changes as expected:

Private Sub FastTimer_Timer()
  Dim TabID As Long, GroupID As Long
  Static OldWorkspaceTabID As Long, OldWorkspaceGroupID As Long   '2009-12: selectionchanged does not work between groups in 13.2
 
  TabID = Me.CB.TabWorkspace.Selected.Index
  GroupID = Me.CB.TabWorkspace.FindGroup(Me.CB.TabWorkspace.Selected)
  If TabID <> OldWorkspaceTabID Or GroupID <> OldWorkspaceGroupID Then
     Me.WorkspaceSelectionChanged
     OldWorkspaceTabID = TabID
     OldWorkspaceGroupID = GroupID
  end if
end sub

Public Sub WorkspaceSelectionChanged()
 
  Set FocusForm = Me.ActiveForm
  ' use this FocusForm to reference the active tab
End Sub


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.