例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

相关推荐
会豪17 分钟前
Electron-Vite (一)快速构建桌面应用
前端
中微子20 分钟前
React 执行阶段与渲染机制详解(基于 React 18+ 官方文档)
前端
唐某人丶21 分钟前
教你如何用 JS 实现 Agent 系统(2)—— 开发 ReAct 版本的“深度搜索”
前端·人工智能·aigc
中微子22 分钟前
深入剖析 useState产生的 setState的完整执行流程
前端
架构师沉默32 分钟前
设计多租户 SaaS 系统,如何做到数据隔离 & 资源配额?
java·后端·架构
遂心_1 小时前
JavaScript 函数参数传递机制:一道经典面试题解析
前端·javascript
小徐_23331 小时前
uni-app vue3 也能使用 Echarts?Wot Starter 是这样做的!
前端·uni-app·echarts
RoyLin1 小时前
TypeScript设计模式:适配器模式
前端·后端·node.js
遂心_1 小时前
深入理解 React Hook:useEffect 完全指南
前端·javascript·react.js
Moonbit1 小时前
MoonBit 正式加入 WebAssembly Component Model 官方文档 !
前端·后端·编程语言