当前位置: 首页>>代码示例>>C#>>正文


C# Range.get_Offset方法代码示例

本文整理汇总了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);
        }
开发者ID:FarrelLabs,项目名称:lab1,代码行数:22,代码来源:ReportBuilder.cs

示例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;
//.........这里部分代码省略.........
开发者ID:Chaika-Sergey,项目名称:IMKS,代码行数:101,代码来源:Form1.cs


注:本文中的Microsoft.Office.Interop.Excel.Range.get_Offset方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。