Quinn-Curtis Forums
Quinn-Curtis Forums
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Tools for Microsoft .Net & .Net Compact Framework
 SPC Control Chart Tools for .Net
 Font size issue
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

gsoldavi

Italy
15 Posts

Posted - 30 Jan 2017 :  04:50:19  Show Profile  Reply with Quote
Dears,

I'm facing with a strange behavior on SPC charts. I have a User Control developed with Vb.NET. This control is dinamically instantiated by code many times and added on TabControl pages (one control per page).
Everything is working perfectly except the very first UC instance! The first one is presented with big fonts instead of the others with the correct dimension.

What could it be? How can I solve this issue?
Thank you.
BR
Giorgio

Edited by - gsoldavi on 30 Jan 2017 04:53:42

quinncurtis

1531 Posts

Posted - 30 Jan 2017 :  16:47:41  Show Profile  Reply with Quote
In the chart definition, define the expected size before the first chart is displayed using the ChartView PreferredSize property.

chartVu.PreferredSize = New Size(1200, 800)

Go to Top of Page

gsoldavi

Italy
15 Posts

Posted - 31 Jan 2017 :  08:16:37  Show Profile  Reply with Quote
Is it the size of the control?
Actually UserControl Dock property is Fill, should I calculate it and set during a particular event on form (I'm thinking about Show event)?
Go to Top of Page

quinncurtis

1531 Posts

Posted - 31 Jan 2017 :  08:46:33  Show Profile  Reply with Quote
Events often don't get fired in the correct order so don't rely on that. Your first chart gets defined and rendered while it still has a default user control size of 100x100, but then it is resized to the windows size, causing fonts to resize proportionately. So give it a default preferred size which is your expected window size. It doesn't have to be exact, just ball park to give font resizing algorithm a starting point. Do it BEFORE you add it to a form, probably in the chart definition method.
Go to Top of Page

gsoldavi

Italy
15 Posts

Posted - 10 Feb 2017 :  12:36:49  Show Profile  Reply with Quote
Hi!
Based on what you said I've found two things:
a. it seems that, after Control.Add(objChart), at very first time, the object is set back to the UC size defined on User Control (despite the code settings). Anyway setting again the size AFTER Control.Add it seems working better.
b. Even the resize works better font size is not customized: I'm setting "SPCGeneralizedTableDisplay.DefaultTableFont" before Init but seems not working.

Please can you help me on setting font correctly?
Go to Top of Page

quinncurtis

1531 Posts

Posted - 11 Feb 2017 :  10:57:34  Show Profile  Reply with Quote
Sorry, we cannot reproduce the problem with SPCGeneralizedTableDisplay.DefaultTableFont. We placed in the SPCApplication1 program before the call to InitSPCTimeVariableControlChart and it worked as expected.

Dim numdatapointsinview As Integer = 17

SPCGeneralizedTableDisplay.DefaultTableFont = New Font("Arial", 16)

' Initialize the SPCTimeVariableControlChart
Me.InitSPCTimeVariableControlChart(charttype, numsamplespersubgroup, numdatapointsinview, timeincrementminutes)

Test this on your end. If it works see if you can modify the program to reproduce your problem. If you are unable to do that, you are going to have to supply us with the complete source to the simplest possible example (project) which reproduces the problem. You can send the zipped example project to support@quinn-curtis.com.

Go to Top of Page

gsoldavi

Italy
15 Posts

Posted - 14 Feb 2017 :  03:39:18  Show Profile  Reply with Quote
Ok thank you.
I prepare a small project and send it to you.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Quinn-Curtis Forums © 2000-07 Quinn-Curtis, Inc. Go To Top Of Page
Powered By: Snitz Forums 2000 Version 3.4.07