Display a progress bar within a column in the DataGridView

This topic contains 1 reply, has 1 voice, and was last updated by  McSqed 3 weeks, 5 days ago.

  • Author
    Posts
  • #82799

    McSqed
    Participant

    Hi ,
    I want to display a progress bar within a column inside a datagridview .
    Sample code below. I want Column 3 to show a progress bar with 70% used bar instead of just the boring text 70.
    Please help

    CLS
     Add-Type -AssemblyName System.Windows.Forms
        Add-Type -AssemblyName System.Drawing
    
        
            
        $Form = New-Object system.Windows.Forms.Form
        $Form.StartPosition = "CenterScreen"
        $Form.Topmost = $True
        $Form.size = New-Object System.Drawing.Size(400,400)
        
        $row = @( "A1", "B1" , "70" )
    
        $dataGridView = New-Object 'System.Windows.Forms.DataGridView'
        $dataGridView.Location = '5,15'
        $dataGridView.Size = '440,575'
         
        $dataGridView.Dock = 'Fill'
        $dataGridView.AutoSizeColumnsMode = 'DisplayedCells'
        $dataGridView.AllowUserToAddRows= $false
        $dataGridView.ReadOnly = $True
         
        $dataGridView.AllowUserToOrderColumns = $True
        $dataGridView.AllowUserToResizeColumns = $True
        $dataGridView.AllowUserToResizeRows = $True
        
        $dataGridView.ColumnCount = 3
        
        $dataGridView.ColumnHeadersVisible = $true
    
        $dataGridView.Rows.Add($row)
    
        $Form.Controls.Add($dataGridView)
        
        $Form.ShowDialog()
  • #82801

    McSqed
    Participant

    This link does what I want to do , but its in C#. Can someone please show me an example in POWERSHELL.

    https://www.codeproject.com/Articles/117021/How-to-Create-ProgressBar-Column-in-DataGridView

You must be logged in to reply to this topic.