金字塔决策交易系统

 找回密码
 

微信登录

微信扫一扫,快速登录

搜索
查看: 24|回复: 0

窗体问题,说类没有定义

[复制链接]

26

主题

110

帖子

110

积分

等级: 免费版

注册:
2022-11-7
曾用名:
发表于 2025-10-11 09:28 | 显示全部楼层 |阅读模式
窗体代码:
'建议窗体对象内的代码只编写与本窗体事件有关的代码,不要使用作用于整个工程的变量及过程函数。
'***********************************************************************************************************
'1. 注释部分为office窗体语句。过程名称和控件名称均不含窗体名。
'2. 而金字塔中,在使用窗体时,过程、事件、控件均需要采用"用窗体名_"的方式处理。如:UserForm_
'3. 若要使用该示例,请将代码粘贴到包含名为 CommandButton1 的命令按钮的窗体的声明变量部分。
'***********************************************************************************************************
'Sub UserForm_Initialize()
'    CommandButton.Caption  = "量化神奇之旅"         
'End Sub

Sub UserForm_Initialize()
    UserForm_CommandButton1.Caption  = "量化神奇之旅"
End Sub

'Sub CommandButton1_Click ()
'    If CommandButton1.Caption = "金字塔--停止" or CommandButton1.Caption  = "量化神奇之旅" Then     
'        CommandButton1.Caption = "金字塔--启动"   
'    Else
'        CommandButton1.Caption = "金字塔--停止"  
'    End If
'End Sub
Sub UserForm_CommandButton3_Click ()
    If UserForm_CommandButton1.Caption = "金字塔--停止" or UserForm_CommandButton1.Caption  = "量化神奇之旅" Then     
        UserForm_CommandButton1.Caption = "金字塔--启动"      
    Else
        UserForm_CommandButton1.Caption = "金字塔--停止"  
    End If        
End Sub

Sub UserForm_Load()
    '窗体启动显示时执行图标设置工作,(见上图中的左上角的窗体图标)
    UserForm.SetTitileIcon("face_doc.ico")
End Sub

Sub UserForm_CommandButton1_Click()
        UserForm_CommandButton2.SetFocus
End Sub

Sub UserForm_CommandButton2_Click()
        UserForm_CommandButton1.SetFocus
End Sub

调用代码如下:
sub testform()
        dim f
        set f = new UserForm
        f.Caption="指定对象的前景色"
end sub


类没有定义?

类没有定义?
截图202510110925407896.png
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 微信登录

本版积分规则

手机版|小黑屋|上海金之塔信息技术有限公司 ( 沪ICP备13035422号 )

GMT+8, 2025-10-11 16:31 , Processed in 0.094764 second(s), 24 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表