Jump to content
Xtreme .Net Talk

grivero

Members
  • Posts

    1
  • Joined

  • Last visited

About grivero

  • Birthday 05/02/1974

Personal Information

  • Visual Studio .NET Version
    Visual Studio Enterprise Architect
  • .NET Preferred Language
    VB.NET

grivero's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. First, create a class with this code... Public Class CNGridMultiLineTextBox Inherits System.Windows.Forms.DataGridTextBoxColumn Protected Overloads Overrides Sub Edit(ByVal source As CurrencyManager, ByVal rowNum As Integer, ByVal bounds As Rectangle, ByVal readOnly1 As Boolean, ByVal instantText As String, ByVal cellIsVisible As Boolean) DataGridTableStyle.DataGrid.Select(rowNum) End Sub Protected Overloads Overrides Sub Paint(ByVal g As System.Drawing.Graphics, ByVal bounds As System.Drawing.Rectangle, ByVal source As System.Windows.Forms.CurrencyManager, ByVal rowNum As Integer, ByVal backBrush As System.Drawing.Brush, ByVal foreBrush As System.Drawing.Brush, ByVal alignToRight As Boolean) MyBase.Paint(g, bounds, source, rowNum, backBrush, foreBrush, alignToRight) g.FillRectangle(backBrush, bounds) Dim vText As String If IsDBNull(MyBase.GetColumnValueAtRow(source, rowNum)) Then vText = "" Else vText = CType(MyBase.GetColumnValueAtRow(source, rowNum), String) End If g.DrawString(vText, Me.TextBox.Font, foreBrush, New RectangleF(bounds.X, bounds.Y, bounds.Width, bounds.Height)) End Sub Protected Overrides Sub ColumnStartedEditing(ByVal editingControl As System.Windows.Forms.Control) End Sub End Class Then update the rowheight of your grid. It did work for me.
×
×
  • Create New...