Results 1 to 4 of 4

Thread: I have a data grid I want to autosize to changed font size

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2024
    Posts
    9

    I have a data grid I want to autosize to changed font size

    I have the following code but it only changes font, not the grid
    any suggestions appreciated, thanks


    Dim newfont As New Font("Lucida'console", 9.0, FontStyle.Bold)
    Me.GridMatrix.Font = newfont

    Me.GridMatrix.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells)
    Me.GridMatrix.AutoResizeRows(DataGridViewAutoSizeRowsMode.AllCells)
    Me.GridMatrix.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize
    GridMatrix.Refresh()

  2. #2
    PowerPoster
    Join Date
    Sep 2005
    Location
    Modesto, Ca.
    Posts
    5,524

    Re: I have a data grid I want to autosize to changed font size

    I have the following code but it only changes font, not the grid
    Not sure what your asking or what you expect to happen.

    Made that property doesn't do what you think it does. Google "datagridview.font property".
    Last edited by wes4dbt; Yesterday at 08:07 PM.

  3. #3

    Thread Starter
    New Member
    Join Date
    Mar 2024
    Posts
    9

    Re: I have a data grid I want to autosize to changed font size

    I thought my request was obvious,

    I have the following code but it only changes font, not the grid
    any suggestions appreciated, thanks

    perhaps i should have said the grid cells stay the same size even though the font is changed, I can only see part of the font because the font is larger and with same size cells I cant read the text in the grid cells

  4. #4
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,435

    Re: I have a data grid I want to autosize to changed font size


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width