回复 1楼songguanglun的帖子
songguanglun 你好,
请问你是在什么级别上设置的?我使用以下代码设置可以正常取出 Cell[0,0] 的 StyleName
- private void Form1_Load(object sender, EventArgs e)
- {
- FarPoint.Win.Spread.NamedStyle backstyle = new FarPoint.Win.Spread.NamedStyle("BlueBack");
- backstyle.BackColor = Color.Blue;
- FarPoint.Win.Spread.NamedStyle text1style = new FarPoint.Win.Spread.NamedStyle("OrangeText", "BlueBack");
- text1style.ForeColor = Color.Orange;
- FarPoint.Win.Spread.NamedStyle text2style = new FarPoint.Win.Spread.NamedStyle("YellowText", "BlueBack");
- text2style.ForeColor = Color.Yellow;
- fpSpread1.NamedStyles.Add(backstyle);
- fpSpread1.NamedStyles.Add(text1style);
- fpSpread1.NamedStyles.Add(text2style);
- fpSpread1.ActiveSheet.Cells[0, 0, 4, 0].StyleName = "OrangeText";
- fpSpread1.ActiveSheet.Cells[0, 1, 4, 1].StyleName = "YellowText";
- }
复制代码 |