FarPoint.Web.Spread.Model 名前空間 > DefaultSheetSelectionModel クラス : SetSelection メソッド |
このメソッドは、アンカー(選択範囲の最初のセル)と、選択範囲に含める行数と列数を指定する場合に使用します。アンカーからエクステントまでの間(両者を含む)が選択範囲(セルの選択された範囲)になります。
private void Page_Load(object sender, System.EventArgs e) { if (this.IsPostBack) return; FpSpread1.ActiveSheetView.ColumnCount = 8; FpSpread1.ActiveSheetView.RowCount = 10; FpSpread1.ActiveSheetView.SelectionBackColor = Color.Yellow; FarPoint.Web.Spread.Model.ISheetSelectionModel model = FpSpread1.ActiveSheetView.SelectionModel; bool b1, b2, b3; int i1; model.AddSelection(0, 0, 3, 3); b1 = model.IsAnyCellInColumnSelected(2); b2 = model.IsAnyCellInRowSelected(2); b3 = model.IsSelected(1,1); i1 = model.Count; ListBox1.Items.Add(Convert.ToString(b1)); ListBox1.Items.Add(Convert.ToString(b2)); ListBox1.Items.Add(Convert.ToString(b3)); ListBox1.Items.Add(Convert.ToString(i1)); } private void Button1_Click(object sender, System.EventArgs e) { FarPoint.Web.Spread.Model.ISheetSelectionModel model = FpSpread1.Sheets[0].SelectionModel; model.ClearSelection(); }
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load If IsPostBack Then Return Dim b1, b2, b3 As Boolean Dim i1 As Integer FpSpread1.ActiveSheetView.ColumnCount = 8 FpSpread1.ActiveSheetView.RowCount = 10 FpSpread1.ActiveSheetView.SelectionBackColor = Color.Yellow Dim model As FarPoint.Web.Spread.Model.ISheetSelectionModel = FpSpread1.Sheets(0).SelectionModel model.AddSelection(0, 0, 3, 3) b1 = model.IsAnyCellInColumnSelected(2) b2 = model.IsAnyCellInRowSelected(2) b3 = model.IsSelected(1,1) i1 = model.Count ListBox1.Items.Add(b1) ListBox1.Items.Add(b2) ListBox1.Items.Add(b3) ListBox1.Items.Add(i1) End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim model As FarPoint.Web.Spread.Model.ISheetSelectionModel = FpSpread1.Sheets(0).SelectionModel model.ClearSelection() End Sub