本文整理汇总了C#中Microsoft.Office.Interop.Excel.Range.get_Offset方法的典型用法代码示例。如果您正苦于以下问题:C# Range.get_Offset方法的具体用法?C# Range.get_Offset怎么用?C# Range.get_Offset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.Office.Interop.Excel.Range
的用法示例。
在下文中一共展示了Range.get_Offset方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddInfo
public void AddInfo(FunctionTableItem[] fun, ValueIs value = ValueIs.Magnitude, bool addChart = false)
{
Excel.Series series;
Excel.Range temp;
range = range.get_Resize(2, fun.Length);
range.set_Value(Missing.Value, GetArray(fun, value));
if (addChart)
{
LastIndex += chartHeight + 10;
chartObject = charts.Add(400, LastIndex, chartWidth, chartHeight);
}
currentChart = chartObject.Chart;
series = ((Excel.SeriesCollection) currentChart.SeriesCollection(Type.Missing)).NewSeries();
temp = range.get_Resize(1, fun.Length);
series.Values = temp;
series.XValues = temp.get_Offset(1, 0);
currentChart.ChartType = Excel.XlChartType.xlXYScatterSmoothNoMarkers;
range = range.get_Offset(3, 0);
}
示例2: Form1
public Form1()
{
InitializeComponent();
double x, y, d, dx, dy, x0, y0;
int y_step;
excelapp = new Excel.Application();
excelapp.Visible = true;
excelapp.SheetsInNewWorkbook = 3;
excelapp.Workbooks.Add(Type.Missing);
excelapp.DisplayAlerts = true;
excelappworkbooks = excelapp.Workbooks;
excelappworkbook = excelappworkbooks[1];
excelsheets = excelappworkbook.Worksheets;
excelworksheet = (Excel.Worksheet)excelsheets.get_Item(1);
excelcells_a1 = excelworksheet.get_Range("A1", Type.Missing);
excelcells = excelcells_a1.get_Offset(0, 0);
///////////////////////////
////// Источники ///////
///////////////////////////
double sourceRadius = 0.2;
sources[0].id = 0;
sources[0].x = 0.27;
sources[0].y = 2.00;
sources[0].radius = sourceRadius;
sources[1].id = 1;
sources[1].x = 1.10;
sources[1].y = 2.81;
sources[1].radius = sourceRadius;
sources[2].id = 2;
sources[2].x = 2.22;
sources[2].y = 2.64;
sources[2].radius = sourceRadius;
sources[3].id = 3;
sources[3].x = 2.80;
sources[3].y = 1.61;
sources[3].radius = sourceRadius;
sources[4].id = 4;
sources[4].x = 2.39;
sources[4].y = 0.51;
sources[4].radius = sourceRadius;
sources[5].id = 5;
sources[5].x = 1.30;
sources[5].y = 0.13;
sources[5].radius = sourceRadius;
sources[6].id = 6;
sources[6].x = 0.36;
sources[6].y = 0.81;
sources[6].radius = sourceRadius;
sources[7].id = 7;
sources[7].x = 1.49;
sources[7].y = 1.50;
sources[7].radius = sourceRadius;
///////////////////////////
////// Приёмники ///////
///////////////////////////
/*
// Вариант один к одному для ВОСЬМИ приёмников
double receiverRadius = 0.23;
double receiverInnerRadius = 0.13;
receiversCount = 8;
receivers[0].id = 0;
receivers[0].x = 0.23;
receivers[0].y = 1.97;
receivers[0].radius = receiverRadius;
receivers[0].innerRadius = receiverInnerRadius;
receivers[1].id = 1;
receivers[1].x = 1.08;
receivers[1].y = 2.76;
receivers[1].radius = receiverRadius;
receivers[1].innerRadius = receiverInnerRadius;
receivers[2].id = 2;
receivers[2].x = 2.23;
receivers[2].y = 2.62;
receivers[2].radius = receiverRadius;
receivers[2].innerRadius = receiverInnerRadius;
receivers[3].id = 3;
receivers[3].x = 2.82;
receivers[3].y = 1.63;
receivers[3].radius = receiverRadius;
//.........这里部分代码省略.........