如何在VB中创建每月员工贷款扣除表 [英] How do I create a monthly employee loan deduction form in VB

查看:66
本文介绍了如何在VB中创建每月员工贷款扣除表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在vb.net上创建每月固定的员工贷款扣除额。这是我尝试过的但是它无法正常工作。



什么我试过了:



i am trying to create a monthly fixed deduction on employee loan in vb.net this is what i tried but it is not working.

What I have tried:

Private Sub monthtx_TextChanged(sender As Object, e As EventArgs) Handles monthtx.TextChanged
    Dim datetimepicker1 As Date
    Dim monthtx As Integer
    datetimepicker1 = Date.Now
    monthtx = Month(datetimepicker1)

    If monthtx = 1 Then
        balanc.Text = deductx.Text - basicsal.Text
    ElseIf monthtx = 2 Then
        balanc.Text = deductx.Text - basicsal.Text
    ElseIf monthtx = 3 Then
        balanc.Text = deductx.Text - basicsal.Text
    ElseIf monthtx = 4 Then
        balanc.Text = deductx.Text - basicsal.Text
    ElseIf monthtx = 5 Then
        balanc.Text = deductx.Text - basicsal.Text
    ElseIf monthtx = 6 Then
        balanc.Text = deductx.Text - basicsal.Text
    ElseIf monthtx = 7 Then
        balanc.Text = deductx.Text - basicsal.Text
    ElseIf monthtx = 8 Then
        balanc.Text = deductx.Text - basicsal.Text
    ElseIf monthtx = 9 Then
        balanc.Text = deductx.Text - basicsal.Text
    ElseIf monthtx = 10 Then
        balanc.Text = deductx.Text - basicsal.Text
    ElseIf monthtx = 11 Then
        balanc.Text = deductx.Text - basicsal.Text
    ElseIf monthtx = 12 Then
        balanc.Text = deductx.Text - basicsal.Text

    End If
End Sub

推荐答案

它不起作用,因为代码没有意义。当每个部分执行完全相同的操作时,为什么你有那么长的 if ... else 序列?你期望从形式 deductx.Text - basicsal.Text 的表达式发生什么?我想你需要回到你的课程笔记并学习VB.NET的基础知识。
It is not working because the code makes no sense. Why do you have that long if ... else sequence when each section performs exactly the same operation? And what do you expect to happen from an expression of the form deductx.Text - basicsal.Text? I think you need to go back to your course notes and study the basics of VB.NET.


这篇关于如何在VB中创建每月员工贷款扣除表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆