Dim C1Ribbon2 As C1Ribbon.C1Ribbon = Ctype(BaseMainForm.controls("C1Ribbon1"),C1Ribbon.C1Ribbon )
Dim d As New system.Windows.Forms.WebBrowser
d.Navigate("http://i.tianqi.com/index.php?c=code&id=12&icon=1&num=5&site=12")'天气预报
Dim c As New C1Ribbon.RibbonControlHost(d)
c.name = "自定义项2"
c.width = 300
c.height = 120
C1Ribbon2.tabs("engga").Groups("功能组3").Items.add(c)
Dim C1Ribbon1 As C1Ribbon.C1Ribbon = Ctype(BaseMainForm.controls("C1Ribbon1"),C1Ribbon.C1Ribbon )
Dim a As New system.Windows.Forms.picturebox
a.BackgroundImage = getimage("E:\管理项目1\Images\01.png")'图片
a.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch
Dim b As New C1Ribbon.RibbonControlHost(a)
b.name = "自定义项1"
b.width = 300
b.height = 120
C1Ribbon1.tabs("engga").Groups("功能组4").Items.add(b)
Dim C1Ribbon3 As C1Ribbon.C1Ribbon = Ctype(BaseMainForm.controls("C1Ribbon1"),C1Ribbon.C1Ribbon )
Dim g As New system.Windows.Forms.picturebox
g.BackgroundImage = getimage("E:\管理项目1\Images\02.jpg")'图片
g.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch
Dim f As New C1Ribbon.RibbonControlHost(g)
f.name = "自定义项3"
f.width = 260
f.height = 120
C1Ribbon3.tabs("engga").Groups("功能组6").Items.Insert(0,f)
但它是会报错:
.NET Framework 版本:4.0.30319.42000
Foxtable 版本:2020.5.29.8
错误所在事件:项目,AfterOpenProject
详细错误信息:
索引超出范围。必须为非负值并小于集合大小。
参数名: index
但我把这段更改后,C1Ribbon3.tabs("engga").Groups("功能组6").Items.Insert(0,f)改为C1Ribbon3.tabs("engga").Groups("功能组6").Items.Insert(f)后,也出现错误代码:
此主题相关图片如下:截屏图片3.jpg
以上这两处地方应该更正,请指教一下
第二个问题,我在功能区设置一个显示时间的,并在AfterOpenProject事件写下代码:
RibbonTabs("engga").Groups("功能组5").Items("标签1").text = "今天是:" & format(Date.now, "G")
然后并在计划任务里增加一个代码:
RibbonTabs("engga").Groups("功能组5").Items("标签1").text = "今天是:" & format(Date.now, "G")
重新打开后,虽然时间是对得上了,但返回编辑时系统一样会报错:
此主题相关图片如下:截屏图片4.jpg
此主题相关图片如下:截屏图片5.jpg
这三个问题请各位老师帮忙指导一下,谢谢.
此主题相关图片如下:微信截图_20210424102825.png