GrapeCity MultiRow Windows Forms Documentation
GDI+ Compatibility Mode

Cells support the string rendering using both GDI as well as GDI+. GDI is used by default. GDI+ is used when the CellStyle.UseCompatibleTextRendering property is set to True. This property works the same as the Label and Button controls in .NET Framework 2.0 and above. The value, True, in the CellStyle.UseCompatibleTextRendering property implies GDI+ compatible mode. The Styles of each of the Cell Types can be used to determine whether the cell types support the GDI+ compatibility mode of the styles.

There are a few limitations due to the differences between GDI and GDI+, if the GDI+ compatibility mode is enabled. Refer to the Limitations section of this document for details.

Enable GDI+ Compatibility Mode

You need to set the CellStyle.UseCompatibleTextRendering property to True to enable the GDI+ compatibility mode.

Using Code

This example sets the UseCompatibleTextRendering property.

[VB]

Imports GrapeCity.Win.MultiRow

GcMultiRow1.Rows(0).Cells(0).Style.UseCompatibleTextRendering = MultiRowTriState.True
GcMultiRow1.Rows(0).Cells(0).Value = "GDI+ Compatibility Mode"

[CS]

using GrapeCity.Win.MultiRow;

gcMultiRow1.Rows[0].Cells[0].Style.UseCompatibleTextRendering = MultiRowTriState.True;
gcMultiRow1.Rows[0].Cells[0].Value = "GDI+ Compatibility Mode";

Distributing Text

You can use the distributed alignment of text when the GDI+ compatibility mode is enabled. To specify the space on the left and right for the distributed text, you can use either or both the padding and equal distribution. Unlike Excel, indent is not applied to the distributed alignment.

Using Code

This example uses the distributed alignment.

[VB]

Imports GrapeCity.Win.MultiRow

GcMultiRow1.Rows(0).Cells(0).Style.UseCompatibleTextRendering = MultiRowTriState.True
GcMultiRow1.Rows(0).Cells(0).Style.TextAdjustment = TextAdjustment.Distribute
GcMultiRow1.Rows(0).Cells(0).Value = "Nebraska"

[CS]

using GrapeCity.Win.MultiRow;

gcMultiRow1.Rows[0].Cells[0].Style.UseCompatibleTextRendering = MultiRowTriState.True;
gcMultiRow1.Rows[0].Cells[0].Style.TextAdjustment = TextAdjustment.Distribute;
gcMultiRow1.Rows[0].Cells[0].Value = "Nebraska";

Rotating Text

You can use the text rotation when the GDI+ compatibility mode is enabled.

Using Code

This example rotates the text.

[VB]

Imports GrapeCity.Win.MultiRow

GcMultiRow1.Rows(0).Cells(0).Style.UseCompatibleTextRendering = MultiRowTriState.True
GcMultiRow1.Rows(0).Cells(0).Style.TextAngle = 45.0F
GcMultiRow1.Rows(0).Cells(0).Value = "Ohio"

[CS]

using GrapeCity.Win.MultiRow;

gcMultiRow1.Rows[0].Cells[0].Style.UseCompatibleTextRendering = MultiRowTriState.True;
gcMultiRow1.Rows[0].Cells[0].Style.TextAngle = 45f;
gcMultiRow1.Rows[0].Cells[0].Value = "Ohio";

Vertical Text

You can use the vertical text feature when the GDI+ compatibility mode is enabled.

Using Code

This example uses vertical text.

[VB]

Imports GrapeCity.Win.MultiRow

gcMultiRow1.Rows(0).Cells(0).Style.UseCompatibleTextRendering = MultiRowTriState.True
gcMultiRow1.Rows(0).Cells(0).Style.TextVertical = MultiRowTriState.True
gcMultiRow1.Rows(0).Cells(0).VerticalResize(50)
gcMultiRow1.Rows(0).Cells(0).Value = "Yellow Line"

[CS]

using GrapeCity.Win.MultiRow;

gcMultiRow1.Rows[0].Cells[0].Style.UseCompatibleTextRendering = MultiRowTriState.True;
gcMultiRow1.Rows[0].Cells[0].Style.TextVertical = MultiRowTriState.True;
gcMultiRow1.Rows[0].Cells[0].VerticalResize(50);
gcMultiRow1.Rows[0].Cells[0].Value = "Yellow Line";

Limitations

See Also

 

 


Copyright © GrapeCity, inc. All rights reserved.

Support Options