Print Page | Close Window

Aligned top problem with picturebox

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=1637
Printed Date: 29 September 2024 at 6:45pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Aligned top problem with picturebox
Posted By: Maui
Subject: Aligned top problem with picturebox
Date 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

 




Replies:
Posted By: Boyd
Date 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.


Posted By: Maui
Date 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.

 



Posted By: Maui
Date Posted: 10 January 2005 at 9:45am
Ack, you cant hide the title bar for just one pane. Its all or nothing :(


Posted By: SuperMario
Date 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.


Posted By: Maui
Date 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.




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