BoldSignEasily embed eSignatures in your .NET applications. Free sandbox with native SDK available.
Private Sub ShowExtendedText(oGrid As Syncfusion.Windows.Forms.Grid.GridControl, nRow As Integer, nCol As Integer) ' Set the label text and width Dim oGraphics As Graphics = oGrid.CreateGraphics() Dim oStyle As GridStyleInfo = oGrid(nRow, nCol) Dim fTextWidth As Single = oGraphics.MeasureString(oStyle.Text, oStyle.GdipFont).Width oGraphics.Dispose() m_oLabel.Text = oStyle.Text m_oLabel.Size = New System.Drawing.Size(CInt(fTextWidth) + 5, oGrid.DefaultRowHeight - 1) ' Compute the cell location Dim oCellPoint As Point = oGrid.ViewLayout.ClientRowColToPoint(oGrid.ViewLayout.RowIndexToVisibleClient(nRow), oGrid.ViewLayout.ColIndexToVisibleClient(nCol)) Dim oScreenPoint As Point = oGrid.PointToScreen(oCellPoint) Dim oFormPoint As Point = m_oLabel.Parent.PointToClient(oScreenPoint) ' Allow for text margins and then fine tune (if oStyle.TextMargins are 1, then ' this code is a bit redundant) oFormPoint.X += oStyle.TextMargins.Left - 1 oFormPoint.Y += oStyle.TextMargins.Top - 1 ' Set the label to computed position m_oLabel.Location = oFormPoint m_oLabel.Visible = True m_oLabel.Font = oGrid.Font m_oLabel.BringToFront() End Sub 'ShowExtendedText