Ejemplo n.º 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;
                     }
                 }
             }
         }
     }
 }
Ejemplo n.º 2
0
        private void  对齐ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Cell cell = DesignHelper.GetSelectedCell(sheet);

            if (cell != null)
            {
                cell.VerticalAlignment = CellVerticalAlignment.Bottom;
                btn_save.Enabled       = true;
            }
        }
Ejemplo n.º 3
0
        private void 右对齐ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Cell cell = DesignHelper.GetSelectedCell(sheet);

            if (cell != null)
            {
                cell.HorizontalAlignment = CellHorizontalAlignment.Right;
                btn_save.Enabled         = true;
            }
        }
Ejemplo n.º 4
0
 //字体设置
 private void FontSet(object sender, EventArgs e)
 {
     using (FontDialog f = new FontDialog())
     {
         if (f.ShowDialog() == DialogResult.OK)
         {
             Cell cell = DesignHelper.GetSelectedCell(sheet);
             if (cell != null)
             {
                 cell.Font        = f.Font;
                 btn_save.Enabled = true;
             }
         }
     }
 }
Ejemplo n.º 5
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;
            }
        }
Ejemplo n.º 6
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;
            }
        }
Ejemplo n.º 7
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;
            }
        }
Ejemplo n.º 8
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));
 }
Ejemplo n.º 9
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;
             }
         }
     }
 }
Ejemplo n.º 10
0
        private void toolStripButton17_Click(object sender, EventArgs e)
        {
            Cell cell = DesignHelper.GetSelectedCell(sheet);

            if (cell != null)
            {
                if (cell.Font == null)
                {
                    cell.Font = new Font("宋体", 9);
                }
                if (cell.Font.Underline)
                {
                    cell.Font = new Font(cell.Font.FontFamily, cell.Font.Size, cell.Font.Style ^ FontStyle.Underline);
                }
                else
                {
                    cell.Font = new Font(cell.Font.FontFamily, cell.Font.Size, cell.Font.Style | FontStyle.Underline);
                }
                btn_save.Enabled = true;
            }
        }