例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

相关推荐
武子康44 分钟前
Java-80 深入浅出 RPC Dubbo 动态服务降级:从雪崩防护到配置中心秒级生效
java·分布式·后端·spring·微服务·rpc·dubbo
caolib1 小时前
无需云服务器的内网穿透方案 -- cloudflare tunnel
运维·服务器·内网穿透·tunnel·cloudflared
灵感__idea1 小时前
JavaScript高级程序设计(第5版):好的编程就是掌控感
前端·javascript·程序员
誰能久伴不乏2 小时前
Linux系统调用概述与实现:深入浅出的解析
linux·运维·服务器
程序员学习随笔2 小时前
Linux进程深度解析(2):fork/exec写时拷贝性能优化与exit资源回收机制(进程创建和销毁)
linux·运维·服务器
-SGlow-2 小时前
MySQL相关概念和易错知识点(2)(表结构的操作、数据类型、约束)
linux·运维·服务器·数据库·mysql
烛阴2 小时前
Mix
前端·webgl
代码续发3 小时前
前端组件梳理
前端
代码改变世界ctw3 小时前
Linux内核设计与实现 - 第14章 块I/O层
linux·运维·服务器
Dreams_l3 小时前
网络编程2(应用层协议,传输层协议)
运维·服务器·网络