Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I don't have a lot of experience with Table Layout Panel, but after taking a quick look at it there seems to be the options of Fixed Size for a fixed number of columns/rows (which you would change in code) and a Percent size setting for each column. For example, when loading a month with 31 days, you would create 31 columns with a percent width of about 3.2258. You could probably do something like this:</p> <pre><code>int numColumns = 31; tableLayoutPanel1.ColumnCount = numColumns; tableLayoutPanel1.ColumnStyles.Clear(); for (int i = 0; i &lt; numColumns; i++) { tableLayoutPanel1.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100f / numColumns)); } </code></pre> <p>This would mean as you resize the window the each day stays the same size and they all expand to fit the width of the control. If that size is too small for you, and you need the columns to be a minimum width, you can put the TableLayoutPanel inside a control which has AutoScroll enabled, and set the minimum size of the TableLayoutPanel like so:</p> <pre><code>int minColumnWidth = 20; tableLayoutPanel1.MinimumSize = new Size(numColumns * minColumnWidth, 0); </code></pre> <p>WPF could do this better but if you aren't experienced with it, it will probably take much longer to do.</p> <p>In Windows Forms, you could always draw the Calendar manually using the Graphics class and OnPaint overriding in a custom control. This would avoid the flickering and slow issues that child controls pose, and should be easier to learn than WPF.</p>
 

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