Aligned top problem with picturebox |
Post Reply |
Author | |
Maui
Groupie Joined: 10 June 2004 Status: Offline Points: 95 |
Post Options
Thanks(0)
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
|
|
Boyd
Senior Member Joined: 08 December 2003 Location: United States Status: Offline Points: 285 |
Post Options
Thanks(0)
|
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.
|
|
Maui
Groupie Joined: 10 June 2004 Status: Offline Points: 95 |
Post Options
Thanks(0)
|
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.
|
|
Maui
Groupie Joined: 10 June 2004 Status: Offline Points: 95 |
Post Options
Thanks(0)
|
Ack, you cant hide the title bar for just one pane. Its all or nothing :(
|
|
SuperMario
Admin Group Joined: 14 February 2004 Status: Offline Points: 18057 |
Post Options
Thanks(0)
|
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 |
|
Maui
Groupie Joined: 10 June 2004 Status: Offline Points: 95 |
Post Options
Thanks(0)
|
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. |
|
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 |