例37:爱好选择

  1. 建立一个新的EXE工程,放两个单选,两个复选框如图33。

图33

  1. 输入代码:

    Sub Form1_Check1_BN_Clicked(hWndForm As hWnd, hWndControl As hWnd)

    复制代码
    Text1.Text = ""
    
    If Check1.Value Then
    
          Text1.Text="你喜欢"  & Check1.Caption
    
    End If
    
    If Check2.Value Then
    
       Text1.Text= Text1.Text & "你喜欢" & Check2.Caption
    
    End If

    End Sub

    Sub Form1_Check2_BN_Clicked(hWndForm As hWnd, hWndControl As hWnd)

    复制代码
    Text1.Text = ""
    
     If Check2.Value Then
    
          Text1.Text="你喜欢"  & Check2.Caption
    
    End If
    
    If Check1.Value Then
    
       Text1.Text=Text1.Text & "你喜欢" & Check1.Caption
    
    End If

    End Sub

    Sub Form1_genda1_BN_Clicked(hWndForm As hWnd, hWndControl As hWnd)

    复制代码
    If genda1.Value Then
    
       Text1.Text="你的性别为" & genda1.Caption
    
    End If

    End Sub

    Sub Form1_genda2_BN_Clicked(hWndForm As hWnd, hWndControl As hWnd)

    复制代码
       If genda2.Value Then
    
       Text1.Text="你的性别为" & genda2.Caption
    
    End If

    End Sub

相关推荐
augenstern4165 分钟前
webpack重构优化
前端·webpack·重构
Persistence___7 分钟前
SpringBoot中的拦截器
java·spring boot·后端
海拥✘9 分钟前
CodeBuddy终极测评:中国版Cursor的开发革命(含安装指南+HTML游戏实战)
前端·游戏·html
嘵奇20 分钟前
Spring Boot 跨域问题全解:原理、解决方案与最佳实践
java·spring boot·后端
黄雪超25 分钟前
JVM——方法内联之去虚化
java·开发语言·jvm
h汉堡35 分钟前
C/C++内存管理
java·c语言·开发语言·c++·学习
寧笙(Lycode)38 分钟前
React系列——HOC高阶组件的封装与使用
前端·react.js·前端框架
asqq841 分钟前
CSS 中的 ::before 和 ::after 伪元素
前端·css
枣伊吕波1 小时前
第六节第二部分:抽象类的应用-模板方法设计模式
android·java·设计模式
xinxiyinhe1 小时前
内存泄漏与OOM崩溃根治方案:JVM与原生内存池差异化排查手册
java·开发语言·jvm