Custom control is different size depending on platform

KarlRhodesKarlRhodes Member Posts: 37
edited 2012-08-20 in NAV Three Tier
Hi All, we have a custom Add-in control which is behaving strangely and wondered if anyone know what could be causing this?

I have 2 copies of the RTC, both are version 6.0.32012.0 and both connect to the same database and have the same DLL versions of the control installed.

However, when I view the control on my local computer copy of the RTC, the control extends beyond the height and width of the page to the right and the bottom. If I view the control on the other machine, it looks perfect.

I thought this was an issue with my local copy of the RTC, but we have just deployed the control in a test environment for our client and their terminal servers are behaving the same way. Both have the same version of the RTC, yet one machine displays the control perfectly, and on the other it extends past the bottom and right of the page.

I should mention that when the page sized is changed all copies of the control (The Dock setting was set to Fill), but the extended versions remain extended.

To demonstrate what I mean, this is how it looks on one machine...

http://www.flickr.com/photos/84064842@N ... hotostream

and this is how it looks on the other...

http://www.flickr.com/photos/84064842@N ... hotostream

Comments

  • KarlRhodesKarlRhodes Member Posts: 37
    Really? No one has seen this before or knows why it's happening?
  • deV.chdeV.ch Member Posts: 543
    Hard to say whats wrong without the code, please provide at least the code in the CreateControl method

    Do you directly pass the Telerik control to nav (CreateControl Method)?
    If so, try to wrap a panel around the Telerik control. Then see if you have problems in the resizing event chain. Subscribe the OnResize event to check this, compare the two clients the working one and the wrong one.

    Try if a Control.Invalidate(); Does the trick, do this when you pass data to the control (this should be called after its created)

    If nothing helps maybe sending a resize window message will help, but its hard to tell from here...
  • KarlRhodesKarlRhodes Member Posts: 37
    I've posted the CreateControl method of my control at the bottom of this reply.

    As you can see, I resize the control by setting it's Dock property to fill. As the RTC windows can be resized, this control should resize to fill all the available space. The control makes use of a number of controls which are all contained in a panel.

    I have a feeling this is somehow service pack or system platform related. As I said in my OP, the exact same code for the control is configured in exactly the same database on 2 clients. One runs Windows 7 64 bit and the other is on Windows Server 2008 R2. The Windows Server RTC works perfectly, the windows 7 one doesn't.

    Unfortunately I have no idea which service packs have been installed on the Server but I know none have been installed on my Windows 7 development pc.
    protected override System.Windows.Forms.Control CreateControl()
    		{
    			try
    			{
    				ScheduleControl RTCSchedule = new ScheduleControl();
    				RTCSchedule.Dock = DockStyle.Fill;
    				return RTCSchedule;
    			}
    			catch (Exception ex)
    			{
    				MessageBox.Show(ex.Message);
    			}
    			return null;
    		}
    
  • deV.chdeV.ch Member Posts: 543
    If there is a deep control layer chain there could be a problem with that, there was a thread about it here on mibuso, it's actually a problem of WinForms.net in general.
    Maybe this relates to your issue tue.

    you can find more about it here: http://www.mibuso.com/forum/viewtopic.php?f=32&t=51616&hilit=rendering

    Its about the drawing event but the event chain in general should be affected. maybe you can try the hack (manually passing the event) as suggested in the linked blogpost.
  • KarlRhodesKarlRhodes Member Posts: 37
    Fixed it.

    The problem was down to the .Net control having an "AutoScaleMode" set to "Font".

    I changed this to "Inherit" and now my control is the correct size on all platforms.
Sign In or Register to comment.