コード例 #1
0
 private void tool_borderSet_Click(object sender, EventArgs e)
 {
     using (FarPoint.Win.Spread.Design.BorderEditor borderedit = new FarPoint.Win.Spread.Design.BorderEditor(fpSpread1))
     {
         borderedit.Shown += new EventHandler(borderedit_Shown);
         DesignHelper.LocalizationCHS(borderedit);
         if (borderedit.ShowDialog() == DialogResult.OK)
         {
             Cell cell = DesignHelper.GetSelectedCell(sheet);
             if (cell != null)
             {
                 List <CellStruct> list = DesignHelper.GetListCellStruct(cell, dt);
                 foreach (CellStruct cellStruct in list)
                 {
                     if (cell.Border == null)
                     {
                         cellStruct.DrawInfo.BoundaryLine.SetNoBoundary();
                     }
                     else
                     {
                         cellStruct.DrawInfo.BoundaryLine.UpperBoundaryLine  = cell.Border.Inset.Top == 1;
                         cellStruct.DrawInfo.BoundaryLine.LowerBoundaryLine  = cell.Border.Inset.Bottom == 1;
                         cellStruct.DrawInfo.BoundaryLine.LeftBoundaryLine   = cell.Border.Inset.Left == 1;
                         cellStruct.DrawInfo.BoundaryLine.RightBooundaryLine = cell.Border.Inset.Right == 1;
                     }
                 }
             }
         }
     }
 }
コード例 #2
0
        private void  对齐ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Cell cell = DesignHelper.GetSelectedCell(sheet);

            if (cell != null)
            {
                List <CellStruct> list = DesignHelper.GetListCellStruct(cell, dt);
                cell.VerticalAlignment = CellVerticalAlignment.Bottom;
                foreach (CellStruct cellStruct in list)
                {
                    cellStruct.DrawInfo.Format.Alignment = DesignHelper.ConvertVAlignmentToStringAlignment(CellVerticalAlignment.Bottom);
                }
                tool_Save.Enabled = true;
            }
        }
コード例 #3
0
        private void 右对齐ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Cell cell = DesignHelper.GetSelectedCell(sheet);

            if (cell != null)
            {
                List <CellStruct> list = DesignHelper.GetListCellStruct(cell, dt);
                cell.HorizontalAlignment = CellHorizontalAlignment.Right;
                foreach (CellStruct cellStruct in list)
                {
                    cellStruct.DrawInfo.Format.LineAlignment = DesignHelper.ConvertHAlignmentToStringAlignment(CellHorizontalAlignment.Right);
                }
                tool_Save.Enabled = true;
            }
        }
コード例 #4
0
        private void tool_cancelBorder_Click(object sender, EventArgs e)
        {
            Cell cell = DesignHelper.GetSelectedCell(sheet);

            if (cell != null)
            {
                FarPoint.Win.BevelBorder border = new FarPoint.Win.BevelBorder(FarPoint.Win.BevelBorderType.Raised, Color.Black, Color.Black, 1, false, false, false, false);
                cell.Border = border;
                List <CellStruct> list = DesignHelper.GetListCellStruct(cell, dt);
                foreach (CellStruct cellStruct in list)
                {
                    cellStruct.DrawInfo.BoundaryLine.SetNoBoundary();
                }
                tool_Save.Enabled = true;
            }
        }
コード例 #5
0
 protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
 {
     if (keyData == Keys.Delete)
     {
         Cell cell = DesignHelper.GetSelectedCell(sheet);
         if (cell != null)
         {
             cell.Text = "";
             List <CellStruct> list = DesignHelper.GetListCellStruct(cell, dt);
             foreach (CellStruct cellStruct in list)
             {
                 cellStruct.Context = "";
             }
             tool_Save.Enabled = true;
         }
     }
     return(base.ProcessCmdKey(ref msg, keyData));
 }
コード例 #6
0
 private void tool_FontSet_Click(object sender, EventArgs e)
 {
     using (FontDialog f = new FontDialog())
     {
         if (f.ShowDialog() == DialogResult.OK)
         {
             Cell cell = DesignHelper.GetSelectedCell(sheet);
             if (cell != null)
             {
                 List <CellStruct> list = DesignHelper.GetListCellStruct(cell, dt);
                 foreach (CellStruct cellStruct in list)
                 {
                     cellStruct.DrawInfo.Font = f.Font;
                 }
                 cell.Font         = f.Font;
                 tool_Save.Enabled = true;
             }
         }
     }
 }