例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

相关推荐
不想写bug呀7 分钟前
多线程案例——单例模式
java·开发语言·单例模式
bantinghy13 分钟前
Linux进程单例模式运行
linux·服务器·单例模式
心平愈三千疾38 分钟前
通俗理解JVM细节-面试篇
java·jvm·数据库·面试
我不会写代码njdjnssj41 分钟前
网络编程 TCP UDP
java·开发语言·jvm
第1缕阳光1 小时前
Java垃圾回收机制和三色标记算法
java·jvm
funnyZpC1 小时前
好用的文档工具👉smart-doc
java
ai小鬼头1 小时前
百度秒搭发布:无代码编程如何让普通人轻松打造AI应用?
前端·后端·github
漂流瓶jz1 小时前
清除浮动/避开margin折叠:前端CSS中BFC的特点与限制
前端·css·面试
前端 贾公子1 小时前
在移动端使用 Tailwind CSS (uniapp)
前端·uni-app
散步去海边1 小时前
Cursor 进阶使用教程
前端·ai编程·cursor