the text box to wrap using a rectangle format

المشرف العام

Administrator
طاقم الإدارة
I'm looking for a way I could format the text box to wrap using a rectangle format.

// Format the legend text if it is not a heading. If it is, we're fine. if (!isHeading) { LegendText = GetFormattedString(LegendText, "Arial", 8, StringLength, 8, ); } // Boldify the ItemName LegendText = LegendText.Replace(ItemName, "" + ItemName + ""); // If the StratCorDiagram is being drawn if (showText == false) { LegendText = "."; // placeholder StringLength = 1; } // See if this legend item should be placed on a new column Ele = MakeTextElement(Point, LegendText, "Arial") as IElement; TempEnv = new EnvelopeClass(); Ele.QueryBounds(Doc.ActiveView.ScreenDisplay, TempEnv); // If the height of the formatted text is larger than the box + space specified if (TempEnv.Height > BoxY + Text2BoxY) { // If the text will spill out below the envelope drawn by the user if (Ycoord - TempEnv.Height < Envelope.YMin) { // Move to a new column - the last number is a fudge factor, looks like it is in inches Xcoord = Xcoord + BoxX + Text2BoxX + StringLength / 72 + ColumnX; // Move to the top Ycoord = Envelope.YMax; // Recreate the text element Point.PutCoords(Xcoord + 0.2 * (IndentTerm - 1) + BoxX + Text2BoxX, Ycoord); Ele = MakeTextElement(Point, LegendText, "Arial") as IElement; } } else // The height of the formatted text is not larger than the box + space defined { // If the box itself will spill out below the envelope drawn by the user if (Ycoord - (BoxY + Text2BoxY) < Envelope.YMin) { // Move to a new column Xcoord = Xcoord + BoxX + Text2BoxX + StringLength / 72 + ColumnX; // Move to the top Ycoord = Envelope.YMax; // Recreate the text element Point.PutCoords(Xcoord + 0.2 * (IndentTerm - 1) + BoxX + Text2BoxX, Ycoord); Ele = MakeTextElement(Point, LegendText, "Arial") as IElement; } }

أكثر...
 
أعلى