FarPoint.Win.SpreadJ アセンブリ > FarPoint.Win.Spread 名前空間 > FpSpread クラス : TouchStripOpening イベント |
'Declaration Public Event TouchStripOpening As EventHandler(Of TouchStripOpeningEventArgs)
'使用法 Dim instance As FpSpread Dim handler As EventHandler(Of TouchStripOpeningEventArgs) AddHandler instance.TouchStripOpening, handler
public event EventHandler<TouchStripOpeningEventArgs> TouchStripOpening
イベント ハンドラが、このイベントに関連するデータを含む、TouchStripOpeningEventArgs 型の引数を受け取りました。次の TouchStripOpeningEventArgs プロパティには、このイベントの固有の情報が記載されます。
プロパティ | 説明 |
---|---|
Area | SpreadTouchStripを表示する領域を示します。 |
Cancel | System.ComponentModel.CancelEventArgsから継承されます。 |
KeepSelection | 選択を維持するかどうかを示す値を取得または設定します。 |
X | タップされた位置の水平位置を取得または設定します。 |
Y | タップされた位置の垂直位置を取得または設定します。 |
True
に設定します。void autoFill_Click(object sender, EventArgs e) { FarPoint.Win.Spread.SpreadView activeView = fpSpread1.GetRootWorkbook().GetActiveWorkbook(); if (activeView != null) { activeView.ShowAutoFillIndicator(); } } private void fpSpread1_TouchStripOpening(object sender, FarPoint.Win.Spread.TouchStripOpeningEventArgs e) { e.Cancel = true; FarPoint.Win.Spread.CellTouchStrip touchStrip = new FarPoint.Win.Spread.CellTouchStrip(this.fpSpread1); touchStrip.Items["Cut"].Visible = false; ToolStripSeparator separator1 = new ToolStripSeparator(); FarPoint.Win.Spread.TouchStripButton autoFill = new FarPoint.Win.Spread.TouchStripButton("AutoFill", System.Drawing.Image.FromFile("C:\\SpreadWin7\\dragfill.png")); autoFill.Click += autoFill_Click; ToolStripSeparator separator2 = new ToolStripSeparator(); ToolStripDropDownButton dropDownMenu = new ToolStripDropDownButton(System.Drawing.Image.FromFile("C:\\SpreadWin7\\dropdown.png")); dropDownMenu.ShowDropDownArrow = false; dropDownMenu.ImageScaling = ToolStripItemImageScaling.None; ContextMenuStrip menu = new System.Windows.Forms.ContextMenuStrip(); menu.Items.Add("Item1"); dropDownMenu.DropDown = menu; touchStrip.Items.AddRange(new ToolStripItem[] { separator1, autoFill, separator2, dropDownMenu }); touchStrip.Show(new Point(e.X - 20, e.Y - 35 - touchStrip.Height)); }
Private Sub autoFill_Click(sender As Object, e As EventArgs) Dim activeView As FarPoint.Win.Spread.SpreadView = fpSpread1.GetRootWorkbook().GetActiveWorkbook() If activeView IsNot Nothing Then activeView.ShowAutoFillIndicator() End If End Sub Private Sub fpSpread1_TouchStripOpening(sender As Object, e As FarPoint.Win.Spread.TouchStripOpeningEventArgs) e.Cancel = True Dim touchStrip As New FarPoint.Win.Spread.CellTouchStrip(Me.fpSpread1) touchStrip.Items("Cut").Visible = False Dim separator1 As New ToolStripSeparator() Dim autoFill As New FarPoint.Win.Spread.TouchStripButton("AutoFill", System.Drawing.Image.FromFile("C:\SpreadWin7\dragfill.png")) AddHandler autoFill.Click, AddressOf autoFill_Click Dim separator2 As New ToolStripSeparator() Dim dropDownMenu As New ToolStripDropDownButton(System.Drawing.Image.FromFile("C:\SpreadWin7\dropdown.png")) dropDownMenu.ShowDropDownArrow = False dropDownMenu.ImageScaling = ToolStripItemImageScaling.None Dim menu As ContextMenuStrip = New System.Windows.Forms.ContextMenuStrip() menu.Items.Add("Item1") dropDownMenu.DropDown = menu touchStrip.Items.AddRange(New ToolStripItem() {separator1, autoFill, separator2, dropDownMenu}) touchStrip.Show(New Point(e.X - 20, e.Y - 35 - touchStrip.Height)) End Sub