Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Command Bars
  New Posts New Posts RSS Feed - Aligned top problem with picturebox
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Aligned top problem with picturebox

 Post Reply Post Reply
Author
Message
Maui View Drop Down
Groupie
Groupie


Joined: 10 June 2004
Status: Offline
Points: 95
Post Options Post Options   Thanks (0) Thanks(0)   Quote Maui Quote  Post ReplyReply Direct Link To This Post Topic: Aligned top problem with picturebox
    Posted: 07 January 2005 at 3:43pm

I have a SDI project using the commandbars and docking control. I have put a menu across the top and a docked pane on the right.

I put a picturebox in the main form and set its Aligned property to 1 - Align Top.

Neither the docking window or commandbar took any notice of it and when it aligned to the top it covered over the commandbars and the top grip area of the docked window.

I clicked on the picturebox and chose Send to Back and re-ran my app.

The docked window now docks nicely under the picturebox but the commandbar is still obscured.

Can anyone tell me how to make the commandbar aware of the picturebox so that it displays properly?

Thanks

 

Back to Top
Boyd View Drop Down
Senior Member
Senior Member


Joined: 08 December 2003
Location: United States
Status: Offline
Points: 285
Post Options Post Options   Thanks (0) Thanks(0)   Quote Boyd Quote  Post ReplyReply Direct Link To This Post Posted: 07 January 2005 at 5:40pm
I'm not certain of the exact solution to you problem, but I have an alternative.  In a SDI app I wrote several months ago, I had a similar problem.  I ended up using a Docking Pane to represent what would normally be the client area.  I forget the exact flags and options, but the concept was to prevent the docking pane from being floated or hidden.  I also hid the title bar for that pane.  I think I also set HideClientArea to True.  In the end, it looked just like the client area.
Back to Top
Maui View Drop Down
Groupie
Groupie


Joined: 10 June 2004
Status: Offline
Points: 95
Post Options Post Options   Thanks (0) Thanks(0)   Quote Maui Quote  Post ReplyReply Direct Link To This Post Posted: 09 January 2005 at 4:21am

Thank you for your suggestion. I will give it a try.

Too bad that the solution has to be (yet again) a work around in order to get the control to function properly.

 

Back to Top
Maui View Drop Down
Groupie
Groupie


Joined: 10 June 2004
Status: Offline
Points: 95
Post Options Post Options   Thanks (0) Thanks(0)   Quote Maui Quote  Post ReplyReply Direct Link To This Post Posted: 10 January 2005 at 9:45am
Ack, you cant hide the title bar for just one pane. Its all or nothing :(
Back to Top
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post Posted: 10 January 2005 at 10:03am
The following code will fill the client area with a picturebox (I used 0-None for Align).

Private Sub CommandBars_Resize()
    
    On Error Resume Next
   
    Dim Left As Long
    Dim Top As Long
    Dim Right As Long
    Dim Bottom As Long
   
    CommandBars.GetClientRect Left, Top, Right, Bottom

    Picture1.Move Left, Top, Right - Left, Bottom - Top

End Sub

Make sure you have:
    DockingPaneManager.SetCommandBars Me.CommandBars

And that you "Send-To-Back" the docking pane control on the form.

I was able to do this with the code above.


Edited by SuperMario
Back to Top
Maui View Drop Down
Groupie
Groupie


Joined: 10 June 2004
Status: Offline
Points: 95
Post Options Post Options   Thanks (0) Thanks(0)   Quote Maui Quote  Post ReplyReply Direct Link To This Post Posted: 30 January 2005 at 6:53am

Thanks for the feedback SuperMario.

I did end up implementing a solution like the one you proposed.

The question I was asking however was why does using the .align property of a picturebox give predictable results when used with a docking pane and not with the command bar?

Had it worked with neither control I would have just got on with it and manually coded the resize as you suggest. However  because I was able to get it half working I was unsure if the fault lay with me or with the controls.

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.201 seconds.