Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Possible bug in AxCWGraph

Solved!
Go to solution

Hi folks,

 

Here's my problem: I have a C# form with controls on it. Many of these controls have their Anchor property set to Top|Right. The size of the form in the designer is set to 1680x1050. If my resolution is set to 1680x1050 then it always comes up correctly.

 

If I change to a smaller resolution(say 1600x900) and the form is set to open as Maximized, then none of my controls move themselves to maintain their distance from the right edge. The controls on the right edge are all sticking out off the form a little. But, if I then unmaximize the window, and I can resize the window and all the controls will maintain their current, incorrect distance from the right edge.

 

If I set the form to start as normal(not maximized) then it opens up with all the controls in the right place, and everything stays in the right place if I resize the form.

 

Just tried to put together a minimal code reproduction and it looks like AxCWGraph is somehow responsible, since this bad behavior only happens when an AxCWGraph control is on the form.

 

Any thoughts?

0 Kudos
Message 1 of 3
(3,845 Views)
Solution
Accepted by Mojo Hand

Mojo Hand,

 

I reproduced the same behavior you described. It appears this is a problem for at least several of our ActiveX controls. I filed a bug report that you can track using #314617.

 

In the meantime, I found a workaround that may be sufficient. You can set the the WindowState to maximized programmatically in the Form constructor after the InitializeComponent() method. I have code that looks like the following:

 

public Form1()
{
    InitializeComponent();
    WindowState = FormWindowState.Maximized;
}

 

National Instruments
Message 2 of 3
(3,832 Views)

Thanks for the reply D Biel. That workaround will do the trick for now.

0 Kudos
Message 3 of 3
(3,824 Views)