08-03-2010 04:37 PM
I have a slide control on my C# form and I have it automatically determine the Major and Minor division spacing based on the max and min range settings. These values change based on user input so it is impossible for me to know all possible values at design time.
I also use custom divisions to put red marks on the slide for a scan I perform at runtime. When I mark the slide with a custom division the text associated with the major divisions disappears. I would like to be able to put custom divisions on the slide but also continue to display the text associated with the major divisions on the slide at the same time even if the custom division falls at the exact location as the major division.
Any suggestion on how to do this?
If this isn't possible is it possible to determine if I am going to collide with a major division so I can add the text to the custom division if the major division is hidden?
I am using measurement studio 8.1 with VS2005.
08-04-2010 06:04 PM
Hi,
Do you have AutoDivisionSpacing enabled for your slide control? If so, I can't see a way to determine the active intervals, so I don't know if you can determine that you are going to collide with a major division out of the box. I have not been able to find a way to enable this collision prevention with the default MajorDivision class and the default CustomDivision class, though as customizable as Measurement Studio controls are, I would hesitate to say that it is impossible. I am seeing what you are seeing (if your custom division gets near a major division, the major division label disappears), but I have yet to find a solution, if one exists.
I'm sorry I don't have any more information for you yet, but I wanted to let you know that I am looking into the issue and hope to have more information soon.
08-05-2010 01:14 PM
I don't believe that there is a way to do this currently. I was looking for an event that we could use (something like AfterDrawPlot on a WaveformGraph) that would allow us to re-draw the missing label, but there is not one that I could find. I'll submit a product suggestion to look into this for future versions of Measurement Studio, but for now I don't think there is a way to do exactly what you want.
If you don't have AutoDivisionSpacing enabled, you should be able to determine what the MajorDivisions are, and then add that information to the CustomDivision's text field if it is in the way.
08-11-2010 10:29 AM
Thanks for the response. I am disappointed that there is no solution. I do have the AutoDivisionSpacing enabled so I was hoping there would be some way I could determine if one of my custom divisions were causing one of the auto generated major divisions to disappear so I could activate text on the custom division so the user would not see a difference.