Custom control is different size depending on platform

KarlRhodes
Member Posts: 37
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
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
0
Comments
-
Really? No one has seen this before or knows why it's happening?0
-
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...0 -
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; }
0 -
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.0 -
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.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions