اذهب الي المحتوي
أوفيسنا

مساعدة تعديل كود


عمر طاهر

الردود الموصى بها

السلام عليكم ورحمة الله

ممكن مساعدة بتعديل الكود

لستة الـ RadioButton لا تعمل

و Figure 4 لا يظهر


    Dim sum As Double
    Dim View_bills As ListView = View_bills.ListView1
    Private Sub Button1_Click_1(sender As Object, e As EventArgs) Handles CalBill.Click
        If AccNum.Text = Nothing Or KWH.Text = Nothing Then
            MsgBox("Please complete the entries!", MsgBoxStyle.Exclamation, Title:="Error!")
        ElseIf Res.Checked = False And Com.Checked = False And Ind.Checked = False Then
            MsgBox("Pleases select the costumer code!", MsgBoxStyle.Exclamation, Title:="Error!")
        Else
            If Res.Checked = True Then
                sum = Val(KWH.Text) * 6.52
            End If
            If Com.Checked = True Then
                If Val(KWH.Text) < 1000 Then
                    sum = 60
                Else
                    sum = Val(KWH.Text) * 4.5
                End If
            End If
            If Ind.Checked = True Then
                If Val(KWH.Text) < 1000 Then
                    sum = 79
                Else
                    sum = Val(KWH.Text) * 6.5
                End If
            End If
            Bill.Text = FormatCurrency(sum)
        End If
    End Sub
    Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Save.Click
        AccNum.Clear()
        KWH.Clear()
        Bill.Clear()
    End Sub
    Private Sub Button4_Click(sender As Object, e As EventArgs) Handles ShowBill.Click
        View_bills.ListView.Show()
    End Sub
    Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Clear.Click
        Dim code As String
        Dim otherItems As String() = {KWH.Text, code, Bill.Text}
        If Res.Checked Then
            code = Res.Text
        ElseIf Com.Checked Then
            code = Com.Text
        ElseIf Ind.Checked Then
            code = Ind.Text
        End If
        If Bill.Text = Nothing Then
            MsgBox("Pleases press Calculate First!", MsgBoxStyle.Exclamation, Title:="Error!")
        Else
            View_bills.ListView.Items.Add(AccNum.Text).SubItems.AddRange(otherItems)
        End If
    End Sub
    Private Sub acc_num_KeyPress(sender As Object, e As KeyPressEventArgs) Handles AccNum.KeyPress
        If e.KeyChar <> ChrW(Keys.Back) Then
            If Char.IsNumber(e.KeyChar) Then
            Else
                MessageBox.Show("Invalid Input! Only Numbers is acceptable.", "Error Message",
               MessageBoxButtons.OK, MessageBoxIcon.Error)
                e.Handled = True
            End If
        End If
    End Sub
    Private Sub kwh_KeyPress(sender As Object, e As KeyPressEventArgs) Handles KWH.KeyPress
        If e.KeyChar <> ChrW(Keys.Back) Then
            If Char.IsNumber(e.KeyChar) Then
            Else
                MessageBox.Show("Invalid Input! Only Numbers is acceptable.", "Error Message",
               MessageBoxButtons.OK, MessageBoxIcon.Error)
                e.Handled = True
            End If
        End If
    End Sub
    Private Sub RadioButton1_CheckedChanged(sender As Object, e As EventArgs) Handles Res.CheckedChanged
        If AccNum.Text = Nothing Or KWH.Text = Nothing Then
            Res.Enabled = False
            Com.Enabled = False
            Ind.Enabled = False
        Else
            Res.Enabled = True
            Com.Enabled = True
            Ind.Enabled = True
        End If
    End Sub
End Class

 

رابط هذا التعليق
شارك

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

زائر
اضف رد علي هذا الموضوع....

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • تصفح هذا الموضوع مؤخراً   0 اعضاء متواجدين الان

    • لايوجد اعضاء مسجلون يتصفحون هذه الصفحه
×
×
  • اضف...

Important Information