Google
 
Web itpro-blogger.blogspot.com
火曜日, 9月 20, 2005

[VB2005]TabControl

■Tabのサイズを変更したいとき
SizeModeプロパティをFixedを指定し、ItemSizeプロパティでサイズを変更する。


火曜日, 9月 13, 2005

[VB2005]FlexGrid

■セルのデータ型を設定する。
Dim cs As C1.Win.C1FlexGrid.CellStyle

cs.DataTypeb = GetType(Integer)

■Borderスタイルを比較する。
Private Sub ToolStripComboBox1_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ToolStripComboBox1.TextChanged
Dim tsmCmb As ToolStripComboBox
tsmCmb = sender
If (C1FlexGrid1.Rows.Count > 2) Then
C1FlexGrid1.Rows(1).Style.Border.Style = tsmCmb.SelectedIndex
C1FlexGrid1.Rows(1).Style.Border.Color = SystemColors.ControlDark
C1FlexGrid1.Cols(1).StyleFixedDisplay.Border.Style = tsmCmb.SelectedIndex
C1FlexGrid1.Cols(1).StyleFixedDisplay.Border.Color = SystemColors.Control
End If
End Sub

Private Sub FG_BorderStyle()
Dim cb As C1.Win.C1FlexGrid.CellBorder
ToolStripComboBox1.Items.Add(cb.Style.None.ToString)
ToolStripComboBox1.Items.Add(cb.Style.Flat.ToString)
ToolStripComboBox1.Items.Add(cb.Style.Double.ToString)
ToolStripComboBox1.Items.Add(cb.Style.Raised.ToString)
ToolStripComboBox1.Items.Add(cb.Style.Inset.ToString)
ToolStripComboBox1.Items.Add(cb.Style.Groove.ToString)
ToolStripComboBox1.Items.Add(cb.Style.Fillet.ToString)
ToolStripComboBox1.Items.Add(cb.Style.Dotted.ToString)
End Sub

Private Function FG_ChangBorderStyle(ByVal pVal As String) As Integer
Dim cb As C1.Win.C1FlexGrid.CellBorder
Select Case pVal
Case cb.Style.None.ToString : FG_ChangBorderStyle = 0
Case cb.Style.Flat.ToString : FG_ChangBorderStyle = 1
Case cb.Style.Double.ToString : FG_ChangBorderStyle = 2
Case cb.Style.Raised.ToString : FG_ChangBorderStyle = 3
Case cb.Style.Inset.ToString : FG_ChangBorderStyle = 4
Case cb.Style.Groove.ToString : FG_ChangBorderStyle = 5
Case cb.Style.Fillet.ToString : FG_ChangBorderStyle = 6
Case cb.Style.Dotted.ToString : FG_ChangBorderStyle = 7
End Select
End Function

■データをクリアして再描画する。
'セルの全てがクリアされる。
C1FlexGrid1.Clear(C1.Win.C1FlexGrid.ClearFlags.All)
'①C1FlexGrid1.Clear(C1.Win.C1FlexGrid.ClearFlags.Content)
'②C1FlexGrid1.Clear(C1.Win.C1FlexGrid.ClearFlags.Style)
'③C1FlexGrid1.Clear(C1.Win.C1FlexGrid.ClearFlags.UserData)
C1FlexGrid1.Rows.Count = 0

'再描画したい処理を記述する。

C1FlexGrid1.Refresh()

●Clearメソッド
 ①Content
  明示的にセルの範囲を指定し、ClearFlags列挙型Content要素によってデータをクリアする。
C1.Win.C1FlexGrid.CellRange cr = c1FlexGrid1.GetCellRange(1,1,2,2);
cr.Clear(C1.Win.C1FlexGrid.ClearFlags.Content);

 ②Style
  Style要素を指定してクリアすると、指定した範囲だけではなく、全ての行および列のスタイル情報がクリア
  される。列幅やセルの色/列の表示位置を変更するドラッグドロップの設定/ソート不可の設定などがデフォ
  ルトに戻る。

 ③UserData
  ?

【FlexGrid for .NET 修正版リリースノート】
http://ftp.grapecity.com/patches/FlexGridNETwin/ReleaseNote_2120033_patch.htm


木曜日, 9月 08, 2005

[VB2005]ContextMenuStrip

■ToolStripSeparatorのWidthプロパティを設定はできない?

■チェックが表示されるエリアを非表示にする。
ShowCheckMarginとShowImageMarginプロパティをFalseにする。


This page is powered by Blogger. Isn't yours?