Back

Topic

[KB516]How to resize the AIGrid

Tags: ActiveX, Scripting

13 years ago
By LM
Options
Print
Applies to:

PcVue version 8.10 SP7 onwards.


Summary:

A sample VBA function to resize the AIGrid component after zoom or screen adaptation.


Details:

An example mimic after ZOOM OUT:

ZoomOut

The same mimic after ZOOM IN:

ZoomIn

The function:

Private Sub Btn_ZoomIn_Click()
    Dim Index As Integer
    Dim MyFont As StdFont

    For Index = 1 To AIGrid1.RowCount   ‘For all the lines except the header
        AIGrid1.RowHeight(Index) = AIGrid1.RowHeight(Index) + 1
    Next
    For Index = 1 To AIGrid1.ColumnCount
        AIGrid1.ColumnWidth(Index) = AIGrid1.ColumnWidth(Index) + 1
    Next

    Set MyFont = AIGrid1.Font
    MyFont.Size = MyFont.Size + 1
    Set AIGrid1.Font = MyFont

    AIGrid1.Width = AIGrid1.TotalWidth
    AIGrid1.Height = AIGrid1.TotalHeight
    Set MyFont = Nothing    ‘release the object
End Sub


Created on: 07 Dec 2011 Last update: 13 May 2024