table problem

Programmers and people with programming knowledge sit here
wazzcob
Posts: 24
Joined: Fri Feb 05, 2021 5:11 am

Re: table problem

Post by wazzcob »

Wow! Almost done, I did it like this:

Code: Select all

private void MainForm_Resize(object sender, EventArgs e)
{
  if (WindowState != FormWindowState.Minimized)
  {
    int colOffset = dataGridView1.RowHeadersWidth + dataGridView1.Columns[0].Width + dataGridView1.Columns[1].Width + 10;
    int minWidth = colOffset + dataGridView1.Columns[2].GetPreferredWidth(DataGridViewAutoSizeColumnMode.DisplayedCells, true);

    if (Width < minWidth)
      dataGridView1.Columns[2].Width = minWidth;

    else
      dataGridView1.Columns[2].Width = Width - colOffset;
  }
}
Confused only by the number 10, picked up by eye.
User avatar
xizer
Posts: 87
Joined: Mon Oct 05, 2020 9:51 am

Re: table problem

Post by xizer »

wazzcob wrote: Thu Jun 10, 2021 3:39 am Confused only by the number 10, picked up by eye.
these are all border borders, padding, etc.
wazzcob
Posts: 24
Joined: Fri Feb 05, 2021 5:11 am

Re: table problem

Post by wazzcob »

xizer wrote: Thu Jun 10, 2021 4:07 am
wazzcob wrote: Thu Jun 10, 2021 3:39 am Confused only by the number 10, picked up by eye.
these are all border borders, padding, etc.
Can I'm recognize them somehow?
User avatar
xizer
Posts: 87
Joined: Mon Oct 05, 2020 9:51 am

Re: table problem

Post by xizer »

wazzcob wrote: Fri Jun 11, 2021 7:47 am Can I'm recognize them somehow?
Is there any GridLineWidth?
wazzcob
Posts: 24
Joined: Fri Feb 05, 2021 5:11 am

Re: table problem

Post by wazzcob »

xizer wrote: Fri Jun 11, 2021 3:23 pm
wazzcob wrote: Fri Jun 11, 2021 7:47 am Can I'm recognize them somehow?
Is there any GridLineWidth?
Found nothing similar.

Fuck this one :lol:
Post Reply