GetClientRect returns wrong values |
Post Reply |
Author | |
blazej
Groupie Joined: 09 February 2005 Location: Canada Status: Offline Points: 53 |
Post Options
Thanks(0)
Posted: 09 February 2005 at 2:09pm |
Hi
I'm in the process of evaluating Xtreme Suite for the purposes of the software project we're working on. I'm using the ActiveX version of the components in C# (VS .NET 2003). I'm using both Command Bars and Docking Pane Manager. I want to create an SDI application do I have created a single document control on my main form. I'm trying to position it properly inside commandBars_ResizeEvent(). Here's what I do (copied straight from sample code): int left, top, right, bottom; commandBars.GetClientRect( out left, out top, out right, out bottom ); dataTableControl.SetBounds( left, top, right - left, bottom - top ); The problem is that commandBars.GetClientRect() returns unrealistic values: left=3090, top=345, right=9630, bottom=9030. Of course, the SetBounds() call is then positioning my document control well beyond the screen. What's wrong? Regards Michal Blazejczyk |
|
SuperMario
Admin Group Joined: 14 February 2004 Status: Offline Points: 18057 |
Post Options
Thanks(0)
|
Might need to add:
private void frmMain_Load(object sender, System.EventArgs e) { .............. foreach (Control ctrl in this.Controls) { &nbs p; if (ctrl is MdiClient) { CommandBars.SetMDIClient(ctrl.Handle.ToInt32()); } } .............. } |
|
blazej
Groupie Joined: 09 February 2005 Location: Canada Status: Offline Points: 53 |
Post Options
Thanks(0)
|
Hi
Yes, but my app is not MDI and none of my controls are MDI. Is this required by the Xtreme Suite? What I did was following the example that I found in the DockingPane C# sample... It works there, why not in my case? The only difference is the presence of CommandBars... Regards Michal |
|
SuperMario
Admin Group Joined: 14 February 2004 Status: Offline Points: 18057 |
Post Options
Thanks(0)
|
You can try:
DockingPaneManager.SetCommandBars (CommandBars.GetDispatch()); Edited by SuperMario |
|
blazej
Groupie Joined: 09 February 2005 Location: Canada Status: Offline Points: 53 |
Post Options
Thanks(0)
|
Yep, I'm doing that.
This behavior looks like a bug to me. I tried remove the command bars from the picture - dockingManager.GetClientRect() still returns way too big values. But the DockingPane sample works fine :-((( Michal |
|
Boyd
Senior Member Joined: 08 December 2003 Location: United States Status: Offline Points: 285 |
Post Options
Thanks(0)
|
Try changing the scale mode of CommandBars and DockingPanes from Twips to Pixels. It defaults to Twips, and that's probably what's giving you the large numbers. I've been using all the controls in C# without problems.
|
|
blazej
Groupie Joined: 09 February 2005 Location: Canada Status: Offline Points: 53 |
Post Options
Thanks(0)
|
Thanks, that was it!
Some strange default, I tell ya! ;) Michal |
|
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 |