サンプル投稿用掲示板 VB2005 〜 用トップページ VB6.0 用 トップページ
- 日時: 2007/07/15 20:16
- 名前: 花ちゃん
- ***********************************************************************************
* カテゴリー:[グリッド関係][データベース][] * * キーワード:フレックスグリッド,MSHFlexGrid,複数行,選択できない,選択出来ない, * ***********************************************************************************
------------------------------------------------------------------------------------ No.652 Re:フレキシブルグリッド複数選択不可 投稿者:ゆう(U) [1999/08/20(金)2:26分] ------------------------------------------------------------------------------------
これならいかが・・・
Option Explicit Private blnMouseDown As Boolean Private blnShift As Boolean
Private Sub Form_Load() With MSFlexGrid1 .FocusRect = flexFocusNone .HighLight = flexHighlightAlways .SelectionMode = flexSelectionByRow End With End Sub
Private Sub MSFlexGrid1_KeyDown(KeyCode As Integer, Shift As Integer) If Shift And vbShiftMask = vbShiftMask Then blnShift = True End If End Sub
Private Sub MSFlexGrid1_KeyUp(KeyCode As Integer, Shift As Integer) If KeyCode = vbKeyShift Then blnShift = False End If End Sub
Private Sub MSFlexGrid1_MouseDown(Button As Integer, _ Shift As Integer, x As Single, y As Single) With MSFlexGrid1 If .MouseRow < .FixedRows Then If .MouseCol < .FixedCols Then .Row = .FixedRows .ColSel = .Cols - 1 End If Else .Row = .MouseRow .ColSel = .Cols - 1 End If If Button = vbLeftButton Then blnMouseDown = True End If End With End Sub
Private Sub MSFlexGrid1_MouseMove(Button As Integer, _ Shift As Integer, x As Single, y As Single) With MSFlexGrid1 If blnMouseDown Then If .Row = .MouseRow Then Exit Sub If .MouseRow < .FixedRows Then If .Row = .FixedRows Then Exit Sub .Row = .FixedRows Else .Row = .MouseRow End If .ColSel = .Cols - 1 End If End With End Sub
Private Sub MSFlexGrid1_MouseUp(Button As Integer, _ Shift As Integer, x As Single, y As Single) If Button = vbLeftButton Then blnMouseDown = False End If End Sub
Private Sub MSFlexGrid1_SelChange() Static blnFlg As Boolean
If Not blnFlg Then blnFlg = True If blnShift Then With MSFlexGrid1 .Row = .RowSel .ColSel = .Cols - 1 End With End If blnFlg = False End If End Sub
念のため・・・
Private Sub Form_Load() With MSFlexGrid1 .FocusRect = flexFocusNone .HighLight = flexHighlightAlways .SelectionMode = flexSelectionByRow .ColSel = .Cols - 1 End With End Sub
と、した方が良いみたいですね。
|