示例#1
0
        /// <summary>
        /// Create about dialog
        /// </summary>
        public AboutForm()
        {
            InitializeComponent();

            lnkHP.Click    += (s, e) => RGUtility.OpenFileOrLink(lnkHP.Text);
            labVersion.Text = "version " + ProductVersion.ToString();

            textBox2.Text = unvell.ReoGrid.Properties.Resources.EULA_EN;
        }
示例#2
0
		/// <summary>
		/// Manually fire the hyperlink click event.
		/// </summary>
		public void PerformClick()
		{
			if (AutoNavigate && !string.IsNullOrWhiteSpace(LinkURL))
			{
				try
				{
					RGUtility.OpenFileOrLink(LinkURL);
				}
				catch { }
			}

			Click?.Invoke(this, null);
		}
示例#3
0
        private void MakeButton()
        {
            var worksheet = reoGridControl.Worksheets[0];

            // L16:M16範囲を結合
            worksheet.Ranges["L17:M17"].Merge();

            // セルボタンを作成
            var button = new CellTypes.ButtonCell("Excelで開く");

            // クリックした場合 Excel で「請求書」を表示する
            button.Click += (s, e) => RGUtility.OpenFileOrLink(filename);

            // セルボタンをワークシートに置く
            worksheet["L17"] = button;
        }
示例#4
0
        /// <summary>
        /// Manually fire the hyperlink click event.
        /// </summary>
        public void PerformClick()
        {
            if (AutoNavigate && !string.IsNullOrWhiteSpace(LinkURL))
            {
                try
                {
                    RGUtility.OpenFileOrLink(LinkURL);
                }
                catch (Exception ex)
                {
                    //MessageBox.Show("Error to open link: " + ex.Message);
                    this.Cell?.Worksheet?.NotifyExceptionHappen(ex);
                }
            }

            Click?.Invoke(this, null);
        }
示例#5
0
        public InvoiceExcelDocDemo()
        {
            InitializeComponent();

            var filename = "_Templates\\Excel\\simple-invoice.xlsx";

            // load tepmlate from Excel file.
            // https://reogrid.net/document/excel-file-format
            //
            reoGridControl.Load(filename);

            var worksheet = reoGridControl.Worksheets[0];

            worksheet.Ranges["K16:L16"].Merge();

            var button = new CellTypes.ButtonCell("Open in Excel");

            button.Click += (s, e) => RGUtility.OpenFileOrLink(filename);

            worksheet["K16"] = button;
        }
示例#6
0
 private void projectHomepageToolStripMenuItem_Click(object sender, EventArgs e)
 {
     RGUtility.OpenFileOrLink("https://reogrid.net/");
 }
示例#7
0
 private void aboutToolStripMenuItem_Click(object sender, EventArgs e)
 {
     RGUtility.OpenFileOrLink("https://reogrid.net/about");
 }
示例#8
0
 private void reportBugToolStripMenuItem_Click(object sender, EventArgs e)
 {
     RGUtility.OpenFileOrLink("http://forum.reogrid.net/");
 }
示例#9
0
        public BuiltInCellTypesDemo()
        {
            InitializeComponent();

            this.worksheet = grid.CurrentWorksheet;

            // ワークシート全体のスタイルを設定
            worksheet.SetRangeStyles(RangePosition.EntireRange, new WorksheetRangeStyle
            {
                // フォント名と縦位置の揃え方を設定
                Flag     = PlainStyleFlag.FontName | PlainStyleFlag.VerticalAlign,
                FontName = "Arial",
                VAlign   = ReoGridVerAlign.Middle,
            });

            // グリッドラインを非表示
            worksheet.SetSettings(WorksheetSettings.View_ShowGridLine | WorksheetSettings.Edit_DragSelectionToMoveCells, false);

            // 選択モードを単一セルのみに設定
            worksheet.SelectionMode = WorksheetSelectionMode.Cell;

            // 選択スタイルを Focus に設定
            worksheet.SelectionStyle = WorksheetSelectionStyle.FocusRect;

            var grayTextStyle = new WorksheetRangeStyle
            {
                Flag      = PlainStyleFlag.TextColor,
                TextColor = Color.DimGray
            };

            worksheet.MergeRange(1, 1, 1, 6);             // B2:G2

            worksheet.SetRangeStyles(1, 1, 1, 6, new WorksheetRangeStyle
            {
                Flag      = PlainStyleFlag.TextColor | PlainStyleFlag.FontSize,
                TextColor = Color.DarkGreen,
                FontSize  = 18,
            });

            worksheet[1, 1] = "内蔵セル型";

            // 列幅を調整
            worksheet.SetColumnsWidth(1, 1, 100);
            worksheet.SetColumnsWidth(2, 1, 30);
            worksheet.SetColumnsWidth(3, 1, 100);
            worksheet.SetColumnsWidth(6, 2, 65);

            // ボタン
            worksheet.MergeRange(3, 2, 1, 2);             // C4:D4
            var btn = new ButtonCell("ボタン");

            worksheet[3, 1] = new object[] { "ボタン: ", btn };
            btn.Click      += (s, e) => ShowText("ボタンがクリックされた。");

            // リンク
            worksheet.MergeRange(5, 2, 1, 3);             // C6:E6
            var link = new HyperlinkCell("https://www.google.com")
            {
                AutoNavigate = false
            };

            worksheet[5, 1] = new object[] { "ハイパーリンク", link };
            link.Click     += (s, e) => RGUtility.OpenFileOrLink(worksheet.GetCellText(5, 2));

            // チェックボックス
            var checkbox = new CheckBoxCell();

            worksheet.SetRangeStyles(8, 2, 1, 1, grayTextStyle);             // C9:C9
            worksheet[7, 1]        = new object[] { "チェックボックス", checkbox, "テキストは別のセルを利用します" };
            worksheet[8, 2]        = "(セル型の編集はキーボードでも変更できます)";
            checkbox.CheckChanged += (s, e) => ShowText("チェックステータスが変更された: " + checkbox.IsChecked.ToString());

            // ラジオボタン
            worksheet[10, 1] = "Radio Button";              // B11
            var radioGroup = new RadioButtonGroup();        // ラジオボタングループを作成

            worksheet[10, 2] = new object[, ] {             // C11
                { new RadioButtonCell()
                  {
                      RadioGroup = radioGroup
                  }, "リンゴ" },
                { new RadioButtonCell()
                  {
                      RadioGroup = radioGroup
                  }, "ミカン" },
                { new RadioButtonCell()
                  {
                      RadioGroup = radioGroup
                  }, "バナナ" }
            };
            radioGroup.RadioButtons.ForEach(rb => rb.CheckChanged += (s, e) =>
                                                                     ShowText("ラジオボタンのステータスが変更された:" + worksheet[rb.Cell.Row, rb.Cell.Column + 1]));
            worksheet[10, 2] = true;
            worksheet[13, 2] = "(RadioGroup に複数のラジオボタンを追加するとお互いに切り替えることができます)";
            worksheet.SetRangeStyles(13, 2, 1, 1, grayTextStyle);               //C14

            // ドロップダウンリスト
            worksheet.MergeRange(15, 2, 1, 3);               // C16:E16
            var dropdown = new DropdownListCell("リンゴ", "ミカン", "バナナ", "ナシ", "カボチャ", "チェリー", "ココナッツ");

            worksheet[15, 1] = new object[] { "ドロップダウン", dropdown };
            worksheet.SetRangeBorders(15, 2, 1, 3, BorderPositions.Outside, RangeBorderStyle.GraySolid);
            dropdown.SelectedItemChanged += (s, e) => ShowText("ドロップダウンの項目が選択された:" + dropdown.SelectedItem);

            // イメージ
            worksheet.MergeRange(2, 6, 5, 2);              // G3:H7
            worksheet[2, 6] = new ImageCell(Resources.computer_laptop);

            // イベント情報
            worksheet.SetRangeBorders("A20:J20", BorderPositions.Top, RangeBorderStyle.GraySolid);
        }
示例#10
0
 private void downloadToolStripMenuItem_Click(object sender, EventArgs e)
 {
     RGUtility.OpenFileOrLink("https://reogrid.net/jp/download");
 }
示例#11
0
 private void reportBugToolStripMenuItem_Click(object sender, EventArgs e)
 {
     RGUtility.OpenFileOrLink("https://github.com/unvell/ReoGrid/issues");
 }
示例#12
0
        public BuiltInTypesDemo()
        {
            InitializeComponent();

            this.worksheet = grid.CurrentWorksheet;

            // set default sheet style
            worksheet.SetRangeStyles(RangePosition.EntireRange, new WorksheetRangeStyle
            {
                Flag     = PlainStyleFlag.FontName | PlainStyleFlag.VerticalAlign,
                FontName = "Arial",
                VAlign   = ReoGridVerAlign.Middle,
            });

            worksheet.SetSettings(WorksheetSettings.View_ShowGridLine |
                                  WorksheetSettings.Edit_DragSelectionToMoveCells, false);
            worksheet.SelectionMode  = WorksheetSelectionMode.Cell;
            worksheet.SelectionStyle = WorksheetSelectionStyle.FocusRect;

            var middleStyle = new WorksheetRangeStyle
            {
                Flag    = PlainStyleFlag.Padding | PlainStyleFlag.HorizontalAlign,
                Padding = new PaddingValue(2),
                HAlign  = ReoGridHorAlign.Center,
            };

            var grayTextStyle = new WorksheetRangeStyle
            {
                Flag      = PlainStyleFlag.TextColor,
                TextColor = Color.DimGray
            };

            worksheet.MergeRange(1, 1, 1, 6);

            worksheet.SetRangeStyles(1, 1, 1, 6, new WorksheetRangeStyle
            {
                Flag      = PlainStyleFlag.TextColor | PlainStyleFlag.FontSize,
                TextColor = Color.DarkGreen,
                FontSize  = 18,
            });

            worksheet[1, 1] = "Built-in Cell Bodies";

            worksheet.SetColumnsWidth(1, 1, 100);
            worksheet.SetColumnsWidth(2, 1, 30);
            worksheet.SetColumnsWidth(3, 1, 100);
            worksheet.SetColumnsWidth(6, 2, 65);

            // button
            worksheet.MergeRange(3, 2, 1, 2);
            var btn = new ButtonCell("Hello");

            worksheet[3, 1] = new object[] { "Button: ", btn };
            btn.Click      += (s, e) => ShowText("Button clicked.");

            // link
            worksheet.MergeRange(5, 2, 1, 3);
            var link = new HyperlinkCell("http://www.google.com")
            {
                AutoNavigate = false
            };

            worksheet[5, 1] = new object[] { "Hyperlink", link };
            link.Click     += (s, e) =>
            {
                try
                {
                    RGUtility.OpenFileOrLink(worksheet.GetCellText(5, 2));
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.ToString());
                }
            };

            // checkbox
            var checkbox = new CheckBoxCell();

            worksheet.SetRangeStyles(7, 2, 1, 1, middleStyle);
            worksheet.SetRangeStyles(8, 2, 1, 1, grayTextStyle);
            worksheet[7, 1]        = new object[] { "Check box", checkbox, "Auto destroy after 5 minutes." };
            worksheet[8, 2]        = "(Keyboard is also supported to change the status of control)";
            checkbox.CheckChanged += (s, e) => ShowText("Check box switch to " + checkbox.IsChecked.ToString());

            // radio & radio group
            worksheet[10, 1] = "Radio Button";
            worksheet.SetRangeStyles(10, 2, 3, 1, middleStyle);
            var radioGroup = new RadioButtonGroup();

            worksheet[10, 2] = new object[, ] {
                { new RadioButtonCell()
                  {
                      RadioGroup = radioGroup
                  }, "Apple" },
                { new RadioButtonCell()
                  {
                      RadioGroup = radioGroup
                  }, "Orange" },
                { new RadioButtonCell()
                  {
                      RadioGroup = radioGroup
                  }, "Banana" }
            };
            radioGroup.RadioButtons.ForEach(rb => rb.CheckChanged += (s, e) =>
                                                                     ShowText("Radio button selected: " + worksheet[rb.Cell.Row, rb.Cell.Column + 1]));
            worksheet[10, 2] = true;
            worksheet[13, 2] = "(By adding radio buttons into same RadioGroup to make them toggle each other automatically)";
            worksheet.SetRangeStyles(13, 2, 1, 1, grayTextStyle);

            // dropdown
            worksheet.MergeRange(15, 2, 1, 3);
            var dropdown = new DropdownListCell("Apple", "Orange", "Banana", "Pear", "Pumpkin", "Cherry", "Coconut");

            worksheet[15, 1] = new object[] { "Dropdown", dropdown };
            worksheet.SetRangeBorders(15, 2, 1, 3, BorderPositions.Outside, RangeBorderStyle.GraySolid);
            dropdown.SelectedItemChanged += (s, e) => ShowText("Dropdown list selected: " + dropdown.SelectedItem);

            // image
            worksheet.MergeRange(2, 6, 5, 2);
            worksheet[2, 6] = new ImageCell(Resources.computer_laptop);

            // information cell
            worksheet.SetRangeBorders(19, 0, 1, 10, BorderPositions.Top, RangeBorderStyle.GraySolid);
        }