View Single Post
 
Old 07-05-2004, 06:00 PM
Flyguy's Avatar
Flyguy Flyguy is offline
Lost Soul

Super Moderator
* Guru *
 
Join Date: May 2001
Location: Vorlon
Posts: 19,164
Arrow Saving / Load MSFlexGrid Settings / Data

Another sample using a class to save / load the settings of the MSFlexGrid to / from a INI style file.

It can save / load the general flexgrid settings, the general layout, the cell data and the layout of the cells.

Code from Form1
Code:
Option Explicit Private Sub Form_Load() Dim lCol As Long, lRow As Long ' Just fill the first grid with some data ' Note: you can resize the columns using the mouse With MSFlexGrid1 .Cols = 10 .Rows = 12 .ColAlignment(-1) = flexAlignCenterCenter .FixedCols = 2 .FixedRows = 2 .AllowUserResizing = flexResizeColumns For lRow = 0 To .Rows - 1 For lCol = 0 To .Cols - 1 .TextMatrix(lRow, lCol) = "R" & lRow & "C" & lCol If lRow / 3 = lRow \ 3 Then If lCol / 2 = lCol \ 2 Then .Row = lRow .Col = lCol .CellFontBold = True End If End If Next lCol Next lRow End With End Sub ' The Save button Private Sub Command1_Click() Dim cFlexSettings As clsFlexSettings Set cFlexSettings = New clsFlexSettings Set cFlexSettings.FlexGrid = MSFlexGrid1 cFlexSettings.SaveSettings "c:\test.flex", True, True, True, True Me.Caption = "c:\test.flex" End Sub ' The Load Button Private Sub Command2_Click() Dim cFlexSettings As clsFlexSettings Set cFlexSettings = New clsFlexSettings Set cFlexSettings.FlexGrid = MSFlexGrid2 cFlexSettings.LoadSettings "c:\test.flex", True, True, True, True End Sub
Attached Files
File Type: zip FlexSettings.zip (10.1 KB, 490 views)
Reply With Quote