Hello to all, i am new at this and i am just learning, i have a scholl project to make a program that needs to have discount base on how much they buy like 5 - 10% | 15 - 25% | 25 - 40% and ofc here is the code.
Imports Microsoft.VisualBasic
Public Class Form1
Private Sub TextBox1_KeyPress(sender As Object, e As KeyPressEventArgs) Handles TextBox1.KeyPress
If Asc(e.KeyChar) < 48 Or Asc(e.KeyChar) > 57 Then
e.Handled = True
MessageBox.Show("Въведете клиентски номер!")
End If
End Sub
Private Sub TextBox2_KeyPress(sender As Object, e As KeyPressEventArgs) Handles TextBox2.KeyPress
If Asc(e.KeyChar) < 65 Or Asc(e.KeyChar) > 90 _
And Asc(e.KeyChar) < 97 Or Asc(e.KeyChar) > 122 Then
e.Handled = True
MessageBox.Show("Въведете Име!")
End If
End Sub
Private Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles TextBox1.TextChanged
End Sub
Private Sub TextBox2_TextChanged(sender As Object, e As EventArgs)
End Sub
Private Sub TextBox1_TextChanged_1(sender As Object, e As EventArgs) Handles TextBox1.TextChanged
If TextBox1.Text.Length >= 9 Then
MessageBox.Show("10 Цифри")
Else
MessageBox.Show("Въведете 10 цифровия си номер!")
End If
End Sub
Private Sub ComboBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox1.SelectedIndexChanged
If ComboBox1.Text = "Дървена" Then
txtPrice.Text = "15лв кв/2"
ElseIf ComboBox1.Text = "Алуминиева" Then
txtPrice.Text = "25лв кв/2"
ElseIf ComboBox1.Text = "PVC" Then
txtPrice.Text = "35лв кв/2"
End If
End Sub
Dim Pay As Integer
Private Sub txtQty_TextChanged(sender As Object, e As EventArgs) Handles txtQty.TextChanged
txtPay.Text = Val(txtQty.Text) * Val(txtPrice.Text) & "лв"
End Sub
Private Sub txtPay_TextChanged(sender As Object, e As EventArgs) Handles txtPay.TextChanged
End Sub
End Class
These are the items :
If ComboBox1.Text = "Дървена" Then
txtPrice.Text = "15лв кв/2"
ElseIf ComboBox1.Text = "Алуминиева" Then
txtPrice.Text = "25лв кв/2"
ElseIf ComboBox1.Text = "PVC" Then
txtPrice.Text = "35лв кв/2"
As you can see they have different value, also i am having an issue when i start to type in textbox2 (that's only for Numbers) every time it says 10 symbols (as i define it "Въведете 10 цифровия си номер") i need that to happen not every time i enter, but when it has only 9 and the person is trying to enter only 9.
I will be very thankfull if some one cloud help me out :)