Commit be00591f by Trevor Kallaste

parandus

parent e386cd41
No preview for this file type
......@@ -35,16 +35,18 @@ Partial Class Form1
'
'txtJada
'
Me.txtJada.Location = New System.Drawing.Point(63, 29)
Me.txtJada.Location = New System.Drawing.Point(94, 45)
Me.txtJada.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5)
Me.txtJada.Name = "txtJada"
Me.txtJada.Size = New System.Drawing.Size(100, 20)
Me.txtJada.Size = New System.Drawing.Size(148, 26)
Me.txtJada.TabIndex = 1
'
'btnJada
'
Me.btnJada.Location = New System.Drawing.Point(193, 26)
Me.btnJada.Location = New System.Drawing.Point(290, 40)
Me.btnJada.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5)
Me.btnJada.Name = "btnJada"
Me.btnJada.Size = New System.Drawing.Size(75, 23)
Me.btnJada.Size = New System.Drawing.Size(112, 35)
Me.btnJada.TabIndex = 2
Me.btnJada.Text = "Lisa jada"
Me.btnJada.UseVisualStyleBackColor = True
......@@ -52,33 +54,37 @@ Partial Class Form1
'lblJada
'
Me.lblJada.AutoSize = True
Me.lblJada.Location = New System.Drawing.Point(8, 32)
Me.lblJada.Location = New System.Drawing.Point(12, 49)
Me.lblJada.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0)
Me.lblJada.Name = "lblJada"
Me.lblJada.Size = New System.Drawing.Size(49, 13)
Me.lblJada.Size = New System.Drawing.Size(72, 20)
Me.lblJada.TabIndex = 4
Me.lblJada.Text = "Lisa jada"
'
'Label1
'
Me.Label1.AutoSize = True
Me.Label1.Location = New System.Drawing.Point(18, 67)
Me.Label1.Location = New System.Drawing.Point(27, 103)
Me.Label1.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(39, 13)
Me.Label1.Size = New System.Drawing.Size(57, 20)
Me.Label1.TabIndex = 5
Me.Label1.Text = "Lisa X:"
'
'txtX
'
Me.txtX.Location = New System.Drawing.Point(63, 64)
Me.txtX.Location = New System.Drawing.Point(94, 98)
Me.txtX.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5)
Me.txtX.Name = "txtX"
Me.txtX.Size = New System.Drawing.Size(100, 20)
Me.txtX.Size = New System.Drawing.Size(148, 26)
Me.txtX.TabIndex = 6
'
'btnLisaX
'
Me.btnLisaX.Location = New System.Drawing.Point(193, 64)
Me.btnLisaX.Location = New System.Drawing.Point(290, 98)
Me.btnLisaX.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5)
Me.btnLisaX.Name = "btnLisaX"
Me.btnLisaX.Size = New System.Drawing.Size(75, 23)
Me.btnLisaX.Size = New System.Drawing.Size(112, 35)
Me.btnLisaX.TabIndex = 7
Me.btnLisaX.Text = "Lisa X"
Me.btnLisaX.UseVisualStyleBackColor = True
......@@ -86,34 +92,38 @@ Partial Class Form1
'listJaguvad
'
Me.listJaguvad.FormattingEnabled = True
Me.listJaguvad.Location = New System.Drawing.Point(304, 26)
Me.listJaguvad.ItemHeight = 20
Me.listJaguvad.Location = New System.Drawing.Point(456, 40)
Me.listJaguvad.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5)
Me.listJaguvad.Name = "listJaguvad"
Me.listJaguvad.Size = New System.Drawing.Size(120, 95)
Me.listJaguvad.Size = New System.Drawing.Size(178, 144)
Me.listJaguvad.TabIndex = 8
'
'Label2
'
Me.Label2.AutoSize = True
Me.Label2.Location = New System.Drawing.Point(154, 107)
Me.Label2.Location = New System.Drawing.Point(231, 165)
Me.Label2.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(69, 13)
Me.Label2.Size = New System.Drawing.Size(103, 20)
Me.Label2.TabIndex = 9
Me.Label2.Text = "Lõpp Vastus:"
'
'lblVastus
'
Me.lblVastus.AutoSize = True
Me.lblVastus.Location = New System.Drawing.Point(229, 107)
Me.lblVastus.Location = New System.Drawing.Point(344, 165)
Me.lblVastus.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0)
Me.lblVastus.Name = "lblVastus"
Me.lblVastus.Size = New System.Drawing.Size(39, 13)
Me.lblVastus.Size = New System.Drawing.Size(18, 20)
Me.lblVastus.TabIndex = 10
Me.lblVastus.Text = "Label3"
Me.lblVastus.Text = "0"
'
'Form1
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleDimensions = New System.Drawing.SizeF(9.0!, 20.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(470, 145)
Me.ClientSize = New System.Drawing.Size(705, 223)
Me.Controls.Add(Me.lblVastus)
Me.Controls.Add(Me.Label2)
Me.Controls.Add(Me.listJaguvad)
......@@ -123,6 +133,7 @@ Partial Class Form1
Me.Controls.Add(Me.lblJada)
Me.Controls.Add(Me.btnJada)
Me.Controls.Add(Me.txtJada)
Me.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5)
Me.Name = "Form1"
Me.Text = "Form1"
Me.ResumeLayout(False)
......
......@@ -62,8 +62,11 @@
Dim i As Integer
Dim j As Integer
Dim b As Boolean = False
Dim chk As Integer = -1
Dim buf As String = txtJada.Text
Dim viganejada As String = "Vigased andmed: "
buf = Replace(buf, ",", " ")
buf = Replace(buf, ";", " ")
......@@ -74,18 +77,25 @@
sJada(chk) = sJada(i)
End If
Next
txtJada.Text = ""
ReDim Preserve sJada(chk)
For i = 0 To sJada.Length - 1
If Integer.TryParse(sJada(i), jada(i)) Then
ReDim Preserve jada(i + 1)
If Integer.TryParse(sJada(i), jada(j)) Then
ReDim Preserve jada(j + 1)
txtJada.Text = txtJada.Text + sJada(i) + " "
bjada = True
j = j + 1
Else
txtJada.Text = "Error"
bjada = False
b = True
viganejada = viganejada & sJada(i) & " "
End If
Next
If b Then
MessageBox.Show(viganejada, "Error", MessageBoxButtons.OK, MessageBoxIcon.Stop)
End If
If (bjada And bX) Then
Arvuta()
......@@ -97,10 +107,16 @@
X = txtX.Text
bX = True
Else
txtX.Text = "Error"
txtX.Text = ""
MessageBox.Show("Jagaja peab olema täisarv", "Jagaja pole täisarv", MessageBoxButtons.OK, MessageBoxIcon.Stop)
X = 1
End If
If (bjada) Then
If X = 0 Then
bX = False
X = 1
MessageBox.Show("Jagaja ei tohi olla 0", "Jagaja on 0", MessageBoxButtons.OK, MessageBoxIcon.Stop)
End If
If (bjada And bX) Then
Arvuta()
End If
End Sub
......
d85ce2820ccd6c8319f439890ddc729ea9c78c31
6a6a9e51ac44f4dcf220f5e48623b94e1192cc5e
......@@ -22,3 +22,15 @@ C:\Users\Tref\source\repos\l6put66\l6put66\obj\Debug\l6put66.vbproj.CoreCompileI
C:\Users\Tref\source\repos\l6put66\l6put66\obj\Debug\l6put66.exe
C:\Users\Tref\source\repos\l6put66\l6put66\obj\Debug\l6put66.xml
C:\Users\Tref\source\repos\l6put66\l6put66\obj\Debug\l6put66.pdb
P:\tt_projekt\tt2018\projekt\src\l6put66\bin\Debug\l6put66.exe.config
P:\tt_projekt\tt2018\projekt\src\l6put66\bin\Debug\l6put66.exe
P:\tt_projekt\tt2018\projekt\src\l6put66\bin\Debug\l6put66.pdb
P:\tt_projekt\tt2018\projekt\src\l6put66\bin\Debug\l6put66.xml
P:\tt_projekt\tt2018\projekt\src\l6put66\obj\Debug\l6put66.vbprojResolveAssemblyReference.cache
P:\tt_projekt\tt2018\projekt\src\l6put66\obj\Debug\l6put66.Form1.resources
P:\tt_projekt\tt2018\projekt\src\l6put66\obj\Debug\l6put66.Resources.resources
P:\tt_projekt\tt2018\projekt\src\l6put66\obj\Debug\l6put66.vbproj.GenerateResource.Cache
P:\tt_projekt\tt2018\projekt\src\l6put66\obj\Debug\l6put66.vbproj.CoreCompileInputs.cache
P:\tt_projekt\tt2018\projekt\src\l6put66\obj\Debug\l6put66.exe
P:\tt_projekt\tt2018\projekt\src\l6put66\obj\Debug\l6put66.xml
P:\tt_projekt\tt2018\projekt\src\l6put66\obj\Debug\l6put66.pdb
12dcfdd638bd0d43e3ee3407fddcba55844a2a5b
5be1ef12f1e095b7da183f04107e72efbc20a364
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment