MultiRow Windows Forms > Developer's Guide > Using MultiRow > Cell Styles > 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. |
You need to set the CellStyle.UseCompatibleTextRendering property to True to enable the GDI+ compatibility mode.
This example sets the UseCompatibleTextRendering property.
Imports GrapeCity.Win.MultiRow GcMultiRow1.Rows(0).Cells(0).Style.UseCompatibleTextRendering = MultiRowTriState.True GcMultiRow1.Rows(0).Cells(0).Value = "GDI+ Compatibility Mode" |
using GrapeCity.Win.MultiRow; gcMultiRow1.Rows[0].Cells[0].Style.UseCompatibleTextRendering = MultiRowTriState.True; gcMultiRow1.Rows[0].Cells[0].Value = "GDI+ Compatibility Mode"; |
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.
This example uses the distributed alignment.
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" |
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"; |
You can use the text rotation when the GDI+ compatibility mode is enabled.
This example rotates the text.
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" |
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"; |
You can use the vertical text feature when the GDI+ compatibility mode is enabled.
This example uses vertical text.
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" |
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"; |