FarPoint.Win.Spread Assembly > FarPoint.Win.Spread Namespace > SheetView Class : GetSelection Method |
DialogResult dlg; fpSpread1.ActiveSheet.SelectionPolicy = FarPoint.Win.Spread.Model.SelectionPolicy.MultiRange; fpSpread1.ActiveSheet.AddSelection(0, 0, 2, 2); fpSpread1.ActiveSheet.AddSelection(0, 3, 2, 2); dlg = MessageBox.Show("Do you want to get one of the selections?", "GetSelection", MessageBoxButtons.YesNo); if (dlg == DialogResult.Yes) { FarPoint.Win.Spread.Model.CellRange cr; cr = fpSpread1.ActiveSheet.GetSelection(1); label1.Text = "The selection covers cells " + cr.Row + ", " + cr.Column + ", " + cr.RowCount + ", " + cr.ColumnCount; }
Dim dlg As DialogResult FpSpread1.ActiveSheet.SelectionPolicy = FarPoint.Win.Spread.Model.SelectionPolicy.MultiRange FpSpread1.ActiveSheet.AddSelection(0, 0, 2, 2) FpSpread1.ActiveSheet.AddSelection(0, 3, 2, 2) dlg = MessageBox.Show("Do you want to get one of the selections?", "GetSelection", MessageBoxButtons.YesNo) If dlg = DialogResult.Yes Then Dim cr As FarPoint.Win.Spread.Model.CellRange cr = FpSpread1.ActiveSheet.GetSelection(1) Label1.Text = "The selection covers cells " & cr.Row & ", " & cr.Column & ", " & cr.RowCount & ", " & cr.ColumnCount End If
Target Platforms: Windows 2000 Professional (SP4), Windows 2000 Server, Windows 2003 Server (SP1), Windows 2008, Windows XP (SP2), Windows Vista, Windows 7, Windows 8