-
November 23rd, 2018, 01:05 AM
#1
drawstring and horizontal scroll
Hi, I have a DataGridView. In some cells, I write with Drawstring in the event Paint.
The problem is that I don't know how to manage the horizontal scroll bar, when moving from the right side to the left side.
I tried
Bitmap flag = new Bitmap(celltopaint.Width, celltopaint.Height);
Rectangle rect = new Rectangle(0, 0, celltopaint.Width, celltopaint.Height);
Graphics flagGraphics = Graphics.FromImage(flag);
flagGraphics.DrawString(("Example", gridd.ColumnHeadersDefaultCellStyle.Font, new SolidBrush(gridd.ColumnHeadersDefaultCellStyle.ForeColor), rect, format);
but this comes out in bold, I don't know why (the same font and brush in the gridview is not in bold)
and I try
Bitmap b = new Bitmap(Width, Height);
gridd.DrawToBitmap(b, celltopaint);
but the bitmap b result without the string.
Any suggestion?Than you.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|