قرار دادن یک خانه DataGridView در حالت Right-to-Left
سلام
چطور میشه در DataGridView یک ستون خاص و یا یک Cell خاص رو در حالت Right-to-Left قرار داد، البته در صورتی که مقدار در قسمت Property مقدار Right-to-left برابر با False باشه.
هدف اصلی من از این کار اینه که در هر ستون یا خانه ای از DataGridView که خواستم بتونم شماره ها رو به فارسی و یا انگلیسی نمایش بدم. اگه روش دیگه ای هم هست بگید.
تشکر
نقل قول: قرار دادن یک خانه DataGridView در حالت Right-to-Left
ميدونم تاپيك قديميه اما محض اطلاع دوستاني كه جستجو ميكنن و به اين تاپيك ميرسن:
Private Sub DG_CellPainting(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellPaintingEvent Args) Handles DG.CellPainting
If (e.ColumnIndex = 1 And e.RowIndex >= 0) Then
e.PaintBackground(e.CellBounds, True)
TextRenderer.DrawText(e.Graphics, e.FormattedValue.ToString(), _
e.CellStyle.Font, e.CellBounds, e.CellStyle.ForeColor, _
TextFormatFlags.RightToLeft)
e.Handled = True
End If
End Sub
نقل قول: قرار دادن یک خانه DataGridView در حالت Right-to-Left
نقل قول:
نوشته شده توسط
شاپرک
ميدونم تاپيك قديميه اما محض اطلاع دوستاني كه جستجو ميكنن و به اين تاپيك ميرسن:
Private Sub DG_CellPainting(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellPaintingEvent Args) Handles DG.CellPainting
If (e.ColumnIndex = 1 And e.RowIndex >= 0) Then
e.PaintBackground(e.CellBounds, True)
TextRenderer.DrawText(e.Graphics, e.FormattedValue.ToString(), _
e.CellStyle.Font, e.CellBounds, e.CellStyle.ForeColor, _
TextFormatFlags.RightToLeft)
e.Handled = True
End If
End Sub
چطوری تو قسمت TextFormatFlags.RightToLeft میتونم right to left رو به yes یا no تنظیم کنم؟
نقل قول: قرار دادن یک خانه DataGridView در حالت Right-to-Left
نقل قول: قرار دادن یک خانه DataGridView در حالت Right-to-Left
دوست عزيز اگر بخواهيم RightToLeft يه ستون و تغيير بديم چكاربايد كنيم؟