タイトル : Re: MSFlexGridについて 投稿日 : 2013/12/03(Tue) 15:09 投稿者 : MSF
こちらに記載するサンプルを作ってたら自己解決しました 下記、サンプルでCellFontSizeを変更しているのですが RowとColを指定していなかったので Command1ボタンを2回目クリックすると 変なところのCellFontSizeが変わっていました 有難うございました。 Private Sub Command1_Click() Dim AA As Long Dim BB As Long Dim Col_Cnt As Long Dim Row_Cnt As Long Dim Str As String Col_Cnt = 3 With MSFlexGrid1 .Cols = 2 + 2 * Col_Cnt .ColWidth(0) = 900 .ColWidth(1) = 1000 .MergeRow(0) = True .MergeCells = flexMergeFree For AA = 0 To Col_Cnt - 1 .ColWidth(2 + AA * 2) = 2000 .ColWidth(3 + AA * 2) = 500 .TextMatrix(0, 2 + AA * 2) = "タイトル" & StrConv(3 + AA, vbWide) .TextMatrix(0, 3 + AA * 2) = "タイトル" & StrConv(3 + AA, vbWide) Next AA .CellFontSize = 8 .TextMatrix(0, 0) = "タイトル1" .CellFontSize = 8 .TextMatrix(0, 1) = "タイトル2" For AA = 0 To 10 Row_Cnt = Row_Cnt + 1 .Rows = Row_Cnt + 1 .TextMatrix(Row_Cnt, 0) = AA .TextMatrix(Row_Cnt, 1) = AA For BB = 0 To Col_Cnt - 1 Str = BB + 1 .TextMatrix(Row_Cnt, 2 + BB * 2) = StrConv(String(6, Str), vbWide) .TextMatrix(Row_Cnt, 3 + BB * 2) = StrConv(BB + 1, vbWide) Next BB Next AA End With End Sub |