Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<ul> <li><p>There are couple of posts that discuss the <a href="https://stackoverflow.com/questions/3444031/wpf-text-rendering-inconsistencies">WPF text rendering inconsistencies</a>.</p></li> <li><p>One of the other posts: <a href="https://stackoverflow.com/questions/5375282/wpf-text-rendering-problem">WPF Text rendering problem</a>, stated that <strong><code>SnapToDevicePixels</code> could ruin text rendering if text has been resized to display across pixels.</strong> The suggested answer was to keep,</p> <p><code>SnapToDevicePixels = True on borders/backgrounds</code> but turn it off for <code>text elements</code>.</p></li> <li><p>As for the current method your are using. Please take a look at one of my earliers posts: <a href="https://stackoverflow.com/questions/14004009/increase-bar-chart-values-with-button-clicks/14004620#14004620">Increase bar chart values with button clicks</a> : I have used <code>DrawString()</code> to add a letter within a <code>rectangle</code>. All drawing is done in a <strong><code>Panel</code></strong>.</p></li> </ul> <p>code: ...</p> <pre><code> panel1.Paint += new PaintEventHandler(panel1_Paint); using (Graphics g = this.panel1.CreateGraphics()) { Brush brush = new SolidBrush(Color.Green); g.FillRectangle(brush, px, py, 20, 20); Pen pen = new Pen(new SolidBrush(Color.White)); g.DrawRectangle(pen, px, py, 20, 20); //add each total5Click into chart block g.DrawString((total5Times).ToString(), new Font("Arial", 7), new SolidBrush(Color.AntiqueWhite), px + 1, py+8, StringFormat.GenericDefault); pen.Dispose();} ... </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload