![]() |
Sticky floating position? |
Post Reply ![]() |
Author | |
uiguy ![]() Newbie ![]() Joined: 22 May 2009 Status: Offline Points: 2 |
![]() ![]() ![]() ![]() ![]() Posted: 23 May 2009 at 8:38am |
My application allows the user to toggle individual toolbars between docked state and floating state. I have implemented this by toggling the CommandBar's Position property between xtpBarFloating or xtpBarTop. My problem is that the CommandBar does not remember its floating position. Consider these steps taken by the user:
- moves the floating toolbar to position 500, 600 on the screen
- docks the toolbar (via a dialog that sets Position to xtpBarTop)
- undocks the toolbar (via dialog that set the Position to xtpBarFloating)
- the toolbar is now position to the upper left portion of the screen, no where near the "last floating" position
Is there a remedy for this? When the user undocks the toolbar via the dialog, I want it to show in the same position it was when it was last floating.
|
|
![]() |
|
Mr.Den ![]() Groupie ![]() ![]() Joined: 26 August 2007 Status: Offline Points: 50 |
![]() ![]() ![]() ![]() ![]() |
Here is how I do it: (this works for me, your mileage may vary
![]() Put in the declarations of a form:
Private Const ID_BAR_TEST = 200
Create the command bar:
private sub SetUpCommandBars Dim obBar As CommandBar on error goto errHandler End Sub Use this to move the Commandbar:
Private Sub TestDockToolBar()
Dim obBar As CommandBar
On Error GoTo errHandler
For Each obBar In obCommandBars If obBar.BarID = ID_BAR_TEST Then obCommandBars.DockToolBar obBar, 900, 900, xtpBarFloating End If Next errHandler: If Err.Number Then ShowErrorM Err.Number, Err.Description, "TestDockToolBar" End If Set obBar = Nothing End Sub You can change the hard coded numbers in the TestDockToolBar/DockToolBar command to variables that you set when changing from floating to docked, it should do what you need. Thanks to Aaron for giving me the tip on the DockToolBar function |
|
Product: Xtreme SuitePro (ActiveX) version 16.3.1
Platform: Windows 7 Professional (64bit) - SP 1 Language: Visual Basic 6.0 SP 6 |
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |