home *** CD-ROM | disk | FTP | other *** search
Wrap
VERSION 5.00 Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX" Begin VB.Form Form1 Caption = "Grid Demo" ClientHeight = 4455 ClientLeft = 60 ClientTop = 345 ClientWidth = 6945 LinkTopic = "Form1" ScaleHeight = 4455 ScaleWidth = 6945 StartUpPosition = 3 'Windows Default Begin VB.ComboBox Combo2 Height = 315 Left = 2415 TabIndex = 4 Text = "10" Top = 3870 Width = 2025 End Begin VB.ComboBox Combo1 Height = 315 Left = 360 TabIndex = 3 Text = "10" Top = 3870 Width = 2025 End Begin VB.CommandButton Command1 Caption = "Reset FontWidth" BeginProperty Font Name = "Verdana" Size = 9.75 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 660 Left = 4605 TabIndex = 2 Top = 3525 Width = 2025 End Begin MSFlexGridLib.MSFlexGrid Grid Height = 2730 Left = 345 TabIndex = 0 Top = 660 Width = 6150 _ExtentX = 10848 _ExtentY = 4815 Rows = 13 Cols = 5 AllowUserResizing= 1 End Begin VB.Label Label3 Caption = "Select FontWidth" BeginProperty Font Name = "Verdana" Size = 9 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 300 Left = 2430 TabIndex = 6 Top = 3510 Width = 1980 End Begin VB.Label Label2 Caption = "Select FontSize" BeginProperty Font Name = "Verdana" Size = 9 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 300 Left = 405 TabIndex = 5 Top = 3510 Width = 1980 End Begin VB.Label Label1 Alignment = 2 'Center BorderStyle = 1 'Fixed Single Caption = "Profit Comparison Table" BeginProperty Font Name = "Verdana" Size = 15.75 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 540 Left = 360 TabIndex = 1 Top = 45 Width = 6120 End Attribute VB_Name = "Form1" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Option Explicit Dim MonthNames(12) As String Dim Profit96(12) As Integer Dim Profit97(12) As Integer Private Sub Combo1_Click() Grid.FillStyle = flexFillRepeat Grid.Col = 1 Grid.Row = 1 Grid.ColSel = 4 Grid.RowSel = 12 Grid.CellFontSize = Val(Combo1.Text) Grid.FillStyle = flexFillSingle Grid.Row = 1 Grid.ColSel = 1 End Sub Private Sub Combo2_Click() Grid.FillStyle = flexFillRepeat Grid.Col = 1 Grid.Row = 1 Grid.ColSel = 4 Grid.RowSel = 12 Grid.CellFontWidth = Val(Combo2.Text) Grid.FillStyle = flexFillSingle Grid.Row = 1 Grid.ColSel = 1 End Sub Private Sub Command1_Click() Grid.FillStyle = flexFillRepeat Grid.Col = 1 Grid.Row = 1 Grid.ColSel = 4 Grid.RowSel = 12 Grid.CellFontWidth = 0 End Sub Private Sub Command3_Click() End Sub Private Sub Command4_Click() End Sub Private Sub Form_Load() Combo1.AddItem "8" Combo1.AddItem "10" Combo1.AddItem "12" Combo1.AddItem "14" Combo1.AddItem "16" Combo1.AddItem "18" Combo1.AddItem "20" Combo1.AddItem "22" Combo1.AddItem "24" Combo2.AddItem "0" Combo2.AddItem "2" Combo2.AddItem "4" Combo2.AddItem "6" Combo2.AddItem "8" Combo2.AddItem "10" Combo2.AddItem "12" Combo2.AddItem "14" Combo2.AddItem "16" Combo2.AddItem "18" Combo2.AddItem "20" MonthNames(1) = "January" MonthNames(2) = "February" MonthNames(3) = "March" MonthNames(4) = "April" MonthNames(5) = "May" MonthNames(6) = "June" MonthNames(7) = "July" MonthNames(8) = "August" MonthNames(9) = "September" MonthNames(10) = "October" MonthNames(11) = "November" MonthNames(12) = "December" Profit96(1) = 22060 Profit96(2) = 21440 Profit96(3) = 20450 Profit96(4) = 19020 Profit96(5) = 18130 Profit96(6) = 19640 Profit96(7) = 22150 Profit96(8) = 21500 Profit96(9) = 23460 Profit96(10) = 22430 Profit96(11) = 20190 Profit96(12) = 19700 Profit97(1) = 22250 Profit97(2) = 22240 Profit97(3) = 18160 Profit97(4) = 18940 Profit97(5) = 19500 Profit97(6) = 22440 Profit97(7) = 23650 Profit97(8) = 22310 Profit97(9) = 18140 Profit97(10) = 20050 Profit97(11) = 20160 Profit97(12) = 21400 Dim irow As Integer Grid.Clear For irow = 1 To 12 Grid.TextMatrix(irow, 1) = Format$(Profit97(irow), "#,###") Grid.TextMatrix(irow, 2) = Format$(Profit96(irow), "#,###") Grid.TextMatrix(irow, 3) = Format$(Grid.TextMatrix(irow, 2) - Grid.TextMatrix(irow, 1), "#,###") Grid.TextMatrix(irow, 4) = Format$(100 * (Grid.TextMatrix(irow, 2) - Grid.TextMatrix(irow, 1)) / Grid.TextMatrix(irow, 1), "#.##") & "%" Grid.FormatString = " |> 1996 Profit |> 1997 Profit |> Gain |> Gain (%) ;| January | February | March | April | May | June | July | August | September | October | November | December " ' Make title row bold Grid.FillStyle = flexFillRepeat Grid.Row = 0 Grid.ColSel = Grid.Cols - 1 Grid.CellFontBold = True Grid.FillStyle = flexFillSingle ' Make title column bold Grid.FillStyle = flexFillRepeat Grid.Col = 0 Grid.RowSel = Grid.Rows - 1 Grid.CellFontBold = True Grid.FillStyle = flexFillSingle Grid.Row = 1 Grid.ColSel = 1 End Sub