laoyebin

VBA里直接用“Calendar.Value”就可以获取日历控件的值了,但VSTO里竟然没有这个属性。

找了半天,原来要这样搞才行:

 

private void monthCalendar1_DateChanged(object sender, DateRangeEventArgs e)
{
    Range["a1"].Value2 = monthCalendar1.SelectionStart.ToShortDateString();
}

看来VBA和VSTO里的日历控件差异很大呀,总结一下:
1、VBA里叫Calendar Control,VSTO里叫monthCalendar。
2、VSTO的日历控件支持17XX年的日期,不过输入进EXCEL变成文本。
2、VSTO里的日历控件更强大,属性、事件更多,不过和VBA比起来找属性也麻烦。

 

分类:

技术点:

相关文章:

  • 2021-07-21
  • 2021-11-21
  • 2022-12-23
  • 2022-12-23
  • 2022-02-26
  • 2022-12-23
  • 2021-11-22
猜你喜欢
  • 2021-08-03
  • 2022-01-16
  • 2022-12-23
  • 2021-11-01
  • 2021-12-14
  • 2022-02-02
  • 2022-02-26
相关资源
相似解决方案