The following code executes the DrawHorizontalLine correctly but not the DrawText statements-unless I move it outside the foreach loop --for example you will note the exact same "DrawText" statement above the foreach loop statement-it works fine....while if I comment it out and use just the one inside the foreach loop-it doesn't work.
Any reason the DrawText won't work inside a foreachloop while the drawhorizontalline does?
(I only pasted the code down to the 2nd DrawText statement-the rest of the forloop works as expected....)
-------code here: -----------------------------
// the following works as -is, I comment it out to test the other location
DrawText("mytag", true, "XXXX" , 0,1130 ,0, Color.Black, largeFont, StringAlignment.Far, Color.Yellow, Color.Yellow, 5);
foreach( KeyValuePair<int, double> kvp in levels )
{
if(showLS==true)
{
if(kvp.Key >= 1 && kvp.Key <= 9)
{
prefix = "L";
lnum = kvp.Key;
label = prefix + lnum;
DrawHorizontalLine("MyHorizontalLine"+kvp.Key, kvp.Value, Color.Blue,DashStyle.Solid,LS_Size);
DrawText("mytag", true, "XXXX" , 0,1130 ,0, Color.Black, largeFont, StringAlignment.Far, Color.Yellow, Color.Yellow, 5);
}
Comment