Ejemplo n.º 1
0
        /// <summary>
        /// 범위에 검색하는 문자가 있으면 범위에 row단위로 글자색/배경색을 변경 하여준다..
        /// </summary>
        /// <param name="fp"></param>
        /// <param name="sv"></param>
        /// <param name="strInStr"></param>
        /// <param name="intChkCol"></param>
        /// <param name="intStCol"></param>
        /// <param name="intEdCol"></param>
        /// <param name="colFore">null 이면 변경 않함</param>
        /// <param name="colBack">null 이면 변경 않함</param>
        public static void Invoke_CellRange_InStr_SetRowColor(FarPoint.Win.Spread.FpSpread fp, FarPoint.Win.Spread.SheetView sv, string strInStr,
                                                              int intChkCol, int intStCol, int intEdCol, object colFore, object colBack)
        {
            if (fp.InvokeRequired)
            {
                fp.Invoke(new delInvoke_CellRange_InStr_SetRowColor(Invoke_CellRange_InStr_SetRowColor), new object[] { fp, sv, strInStr, intChkCol, intStCol,
                                                                                                                        intEdCol, colFore, colBack });
                return;
            }

            for (int y = 0; y < sv.Rows.Count; y++)
            {
                if (sv.Cells[y, intChkCol].Text.IndexOf(strInStr) >= 0)
                {
                    if (colFore != null)
                    {
                        sv.Cells[y, intStCol, y, intEdCol].ForeColor = (Color)colFore;
                    }
                    if (colBack != null)
                    {
                        sv.Cells[y, intStCol, y, intEdCol].BackColor = (Color)colBack;
                    }
                }
            }

            fp.Refresh();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 범위에 ForeColor와 BackColor를 변경하여 준다..
        /// </summary>
        /// <param name="fp"></param>
        /// <param name="sv"></param>
        /// <param name="intStRow">시작 row</param>
        /// <param name="intEdRow">종료 row</param>
        /// <param name="intStCol">시작 col</param>
        /// <param name="intEdCol">종료 col</param>
        /// <param name="colFore">object color - 변경 안할시에는 null</param>
        /// <param name="colBack">object color - 변경 안할시에는 null</param>
        public static void Invoke_CellRange_SetRowColor(FarPoint.Win.Spread.FpSpread fp, FarPoint.Win.Spread.SheetView sv, int intStRow, int intEdRow, int intStCol, int intEdCol,
                                                        object colFore, object colBack)
        {
            if (fp.InvokeRequired)
            {
                fp.Invoke(new delInvoke_CellRange_SetRowColor(Invoke_CellRange_SetRowColor), new object[] { fp, sv, intStRow, intEdRow, intStCol, intEdCol, colFore, colBack });
                return;
            }

            if (colFore != null)
            {
                sv.Cells[intStRow, intStCol, intEdRow, intEdCol].ForeColor = (Color)colFore;
            }
            if (colBack != null)
            {
                sv.Cells[intStRow, intStCol, intEdRow, intEdCol].BackColor = (Color)colBack;
            }



            fp.Refresh();
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 해당 Row의 forecolor과 backcolor을 변경한다.
        /// </summary>
        /// <param name="fp"></param>
        /// <param name="sv"></param>
        /// <param name="intRow"></param>
        /// <param name="colFore">null 이면 변경 않</param>
        /// <param name="colBack">null 이면 변경 않</param>
        public static void Invoke_Row_SetColor(FarPoint.Win.Spread.FpSpread fp, FarPoint.Win.Spread.SheetView sv, int intRow, object colFore, object colBack)
        {
            if (fp.InvokeRequired)
            {
                fp.Invoke(new delInvoke_Row_SetColor(Invoke_Row_SetColor), new object[] { fp, sv, intRow, colFore, colBack });
                return;
            }

            if (intRow >= sv.RowCount)
            {
                return;
            }

            if (colBack != null)
            {
                sv.Rows[intRow].BackColor = (Color)colBack;
            }
            if (colFore != null)
            {
                sv.Rows[intRow].ForeColor = (Color)colFore;
            }

            fp.Refresh();
        }